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
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
Hashes for logrouter-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97236e786a41004528bfe2e34d323aa9b2d2dd1543561acc51e5191a0d74bce |
|
MD5 | 21961ad28c8bdf1b291028ad322edafb |
|
BLAKE2b-256 | 97a1addeab8823e8686e5e976b320ed16551917bdb054626ada2258831e74504 |