rlog-async
Fork of https://github.com/lobziik/rlog
Difference: communications with redis in another thread, so log in unavailable redis doesn't affect your app.
Installation
From pypi:
$ pip install rlog-async
From source:
$ sudo python setup.py install
Usage
>>> from rlog import RedisHandler
>>> logger = logging.getLogger()
>>> logger.addHandler(RedisHandler(channel='test'))
>>> logger.warning("Spam!")
>>> logger.error("Eggs!")
Redis clients subscribed to test will get a json log record by default.
RedisHandler and RedisListHandler also accepted all redis client settings as kwargs. More info about client settings you may find in redis-py documentation.
Custom formatters also supported, handlers accept this as formatter keyword argument. JSONFormatter from this package used as default.
You can use the redis-cli shell that comes with redis to test this. At
the shell prompt, type subscribe my:channel (replacing with the channel
name you choose, of course). You will see subsequent log data printed in the
shell.
Also you can use it with Django:
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'redis': {
'level': 'DEBUG',
'class': 'rlog_async.RedisHandler',
'host': 'localhost',
'password': 'redis_password',
'port': 6379,
'channel': 'my_amazing_logs'
}
},
'loggers': {
'django': {
'level': 'INFO',
'handlers': ['redis'],
'propagate': True,
},
}
}
You can also simply use it with logstash.
Metadata
Release files for rlog-async 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rlog-async-0.0.3.tar.gz | 4.7 kB | Without provenance | Details |
Release files / rlog-async-0.0.3.tar.gz
| Download URL | rlog-async-0.0.3.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64fd411c0278129f4827971f99e9bfa0b238df6263ed3cda728813981a0a6272
|
|
BLAKE2b-256 checksum How to use checksums |
3473d18a73c21086ce6688db67b3bad0eb5938cdc728b7ac90849dd75ed44a1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.6
|
Security for rlog-async 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.