Skip to main content

Sophisticated logging handlers.

Project description

# starlog

A python library to improve python's standard logger capabilities.

Available logging handlers:

- Status log handler - aggregates log records
- Multiprocess log handler (`multiprocessing.Queue` or `zmq` based)
- Lookback log handler - logs more verbose older log records in case an error is logged

[Full Documentation](https://starlog.readthedocs.io/en/latest/)


## Status Log Handler

A log handler that aggregates every log and does some statistics on it.
It generates a log message in regular intervals.


Example usage:

```python
import logging

logging.config.fileConfig('logging-status.conf', disable_existing_loggers=False)

logging.info('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ')
logging.info('sed diam nonumy eirmod tempor invidunt ut labore et dolore ')
logging.info('magna aliquyam')
```

The final output prints 1 log line.

```
2019-03-05 23:53:31 log messages: 0 ERROR, 0 WARNING 3 INFO
```


## Lookback Log Handler

```python
import logging

# with capacity=2
logging.config.fileConfig('logging-lookback.conf', disable_existing_loggers=False)

logging.info('Lorem ipsum ')
logging.info('dolor sit amet, ')
logging.info('consetetur sadipscing elitr, ')
logging.info('sed diam nonumy eirmod ')
logging.info('tempor invidunt ut labore et dolore ')
logging.error('magna aliquyam')
```

The final output will only print the last 3 logs.

```
2019-03-24 17:50:18 [ INFO] sed diam nonumy eirmod
2019-03-24 17:50:18 [ INFO] tempor invidunt ut labore et dolore
2019-03-24 17:50:25 [ ERROR] magna aliquyam
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlog-1.1.0.tar.gz (15.9 kB view details)

Uploaded Source

File details

Details for the file starlog-1.1.0.tar.gz.

File metadata

  • Download URL: starlog-1.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15rc1

File hashes

Hashes for starlog-1.1.0.tar.gz
Algorithm Hash digest
SHA256 19e2a1b2d01b2e490cc0769bb8ea45f63381809ae9ac7a87dcfa4d3fd46b4e70
MD5 123356e1bc75ba56a61bf39004f78079
BLAKE2b-256 65f195ba91a871c1fd86ca1aa57fb924401ae541dbc219e79b300b0236904424

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page