Logging json formatter
Project description
Logging Json Formatter
import logging
from qstd_logger_json_formatter import JsonFormatter, configure
JsonFormatter\
.set_parse_payload_root_logger('app')\
.set_formatter(
'sanic.access',
lambda record: dict(
level=record.levelname,
message=record.message,
host=record.host,
request=record.request,
status=record.status,
byte=record.byte,
label=record.name,
pname=record.processName,
pid=record.process,
timestamp=record.asctime
)
)
configure(JsonFormatter)
app_logger = logging.getLogger('app')
app_logger.info('Example message', dict(string='string', number=1))
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 qstd_logger_json_formatter-0.1.2.tar.gz
.
File metadata
- Download URL: qstd_logger_json_formatter-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a036a541ee1b27fec1f663f1246eb94e142626ac27b9b1f2a72b944953e25970 |
|
MD5 | 7dc03c11f92d5885453ade31d27ad9ba |
|
BLAKE2b-256 | 43cd35899372bd50e95175ae80f9edab0d0b55fc7b790c254078c196203fcefc |
File details
Details for the file qstd_logger_json_formatter-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: qstd_logger_json_formatter-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac6e7c44ca5ae948d53e47af0ed9edea165f59a0fe5a347e5e4590a428f17f7b |
|
MD5 | aa43ecaa379fe860bba5e640fc599289 |
|
BLAKE2b-256 | 102c9772e99e4c1b0ceca9cbd5435d610a0ed214be64fac23bd391e0d472aaab |