A logging formatter that appends extra data as JSON, e.g. for loggly
Project description
A logging Formatter that appends extra data as JSON, e.g. for loggly
USAGE
Using dictConfig
import logging.config
logging.config.dictConfig({
'version': 1,
'formatters': {
'append_json': {
'()': 'logging_json_formatter.AppendJSONFormatter',
'format': '%(asctime)s %(name)s %(levelname)s %(funcName)s %(filename)s:%(lineno)s %(message)s',
# only use a specific set of keys
'limit_keys_to': ['org_uuid', 'app_uuid'],
# force keys that are ignored by default
'force_keys': ('levelname', 'lineno'),
}
},
'handlers': {
'syslog': {
'level': 'ERROR',
'class': 'logging.handlers.SysLogHandler'
'address': '/dev/log',
'formatter': 'append_json'
},
},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-logging-json-formatter-0.1.0.tar.gz
.
File metadata
- Download URL: python-logging-json-formatter-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39078cb87291bfdcda6e763eb33c87250080414fcc23f86f68a97b50d9391e61 |
|
MD5 | 3bf2e66875bb5ee08e5ad9b8c8753607 |
|
BLAKE2b-256 | e82f116a7d04351cf1e2a428eabd4b0ea0ee8520b45cece163fded796900ac20 |
File details
Details for the file python_logging_json_formatter-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: python_logging_json_formatter-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a1de38130580516e5cde9fdb4fb32dbca3b36905e811c22562662b309f8c8e |
|
MD5 | a694dce09334a148b2b182601ba9fe05 |
|
BLAKE2b-256 | c6e82d1a7a117eef998cb299749d590ed2b7339ed9c0fa8c6c88df4394bf8c1a |