A JSON logger for map colonies project
Project description
json-logger
Installation
pip3 install mapcoloniesjsonlogger
Usage Example
from MapColoniesJSONLogger.logger import generate_logger
import os
log = generate_logger('service_name', log_level='INFO', handlers=[{'type': 'rotating_file', 'path': '/var/log/service.log'}])
log.info('basic message')
log.info('message with extra fields', extra={'extra.field': 'extra_value', 'service': 'some_service'}) # supports nesting of fields
log.debug('will not be in a file')
Configuration Example
The configuration dict bellow is used by the package. For more information on logging configuration see logging.config docs
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
Close
Hashes for MapColoniesJSONLogger-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0adc1ccf87cd895fae209ac5c35ea7903a758997687381d1e1abc25986b4e29 |
|
MD5 | 8786999b1d44727d6d0d10ac374e34fe |
|
BLAKE2b-256 | eeed7c6206fb9f487b8639b5a89a06cd5aa31133ef4ce70b8618d7828ba1e3ea |
Close
Hashes for MapColoniesJSONLogger-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63d7f26a4c002dd57333e8d38957532c6cebe5b68876bd7e2625108be198008 |
|
MD5 | 213f9f47ffbbc05e703bfb29e85ba877 |
|
BLAKE2b-256 | 525e3b31c34dc0163a832af84ac9ff8a20f036df8d5bb6ac1842bac8221a6dbb |