Skip to main content

Logging json formatter

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

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


Download files

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

Source Distribution

qstd_logger_json_formatter-0.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qstd_logger_json_formatter-0.2.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file qstd_logger_json_formatter-0.2.0.tar.gz.

File metadata

File hashes

Hashes for qstd_logger_json_formatter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b72db3dd570eead63333bd7a262bfd248169f1f1459707b48177c1bebe065095
MD5 c1ca5b608b0e61bd675d9b58200e33fd
BLAKE2b-256 28256c0af6705dab80f3303bbcfb54ca5a58389bc21f42c6548f94671405eed9

See more details on using hashes here.

File details

Details for the file qstd_logger_json_formatter-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qstd_logger_json_formatter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de3e309611723a39e344ceea1360290e618b0b27a7488b5bcaac778679ba6644
MD5 f7039f2d0d8954433004e7d5871ee022
BLAKE2b-256 f1396d99b576fa57fba24311e18e3b57e90f558bc6579420e600651a2afd5350

See more details on using hashes here.

Supported by

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