Skip to main content

Uses structlog to create two loggers, a stdout logger with key-value args and optional colour, and a file logger in JSON format with log-rotation.

Project description

Compatibility Implementations Format Code_Style

Uses structlog to create two loggers, a stdout logger with key-value args and optional colour, and a file logger in JSON format with log-rotation.

Documentation

StructLogger’s documentation can be found at https://structlogger.readthedocs.io

Installing StructLogger

StructLogger can be installed from Pypi using pip:

pip install structlogger

Example

StructLogger defines a set of standard parameters that should get you going quickly and easily. Settings are retrofitted to the standard logging module to ensure any of your dependencies will adhere to the same logging format.

import structlog
from structlogger import configure_logger, __version__

configure_logger()

log = structlog.getLogger()

log.info('Welcome to structlogger', version=__version__)

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

structlogger-0.1.3.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

structlogger-0.1.3-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

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