Skip to main content

A package that allows logs to be routed to different handlers based on a discriminant

Project description

python-log-router

A package that allows logs to be routed to different handlers based on a discriminant.

Installation

pip install logrouter

Usage

Call logrouter.setup_logging() to setup the logging configuration by providing the configuration yaml absolute file path. You can also set the configuration file using an environment variable. Specify the env_path parameter.

For an example of a configuration file, refer to the default configuration file. You can specify the handler by replacing handlers.single_handler_class with the name of your handler. Default is logrouter.logrouter.DefaultHandler.

The default logging configuration will route the logs based on the discriminator field of the LogRecord object. To use the default configuration, call logrouter.setup_logging(use_default_config=True).

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

logrouter-0.0.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

logrouter-0.0.1-py3-none-any.whl (8.0 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