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.0.tar.gz
.
File metadata
- Download URL: qstd_logger_json_formatter-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0726bb6fc5f1def6069f02db2df894c3786c5efd6932af77fea15b17c0d3b26 |
|
MD5 | 29f665331e598ea339ad339b2f0fdf1f |
|
BLAKE2b-256 | 404d067aa1086aae82e700afdbc795bcea4ddc78eae248eaa5e8f8adca610b4e |
File details
Details for the file qstd_logger_json_formatter-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: qstd_logger_json_formatter-0.1.0-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 | 47d7ab3a21996dcc174a7b54de09843f038e6469d369b89f359fb8d5d3d287ea |
|
MD5 | 50351d81324a18c73b816d68c1e00286 |
|
BLAKE2b-256 | 9c2fc1dc2aaf1598bd1e10d21d6434bb53c1d8f5c29eeac8a8b48eefa84f8608 |