Skip to main content

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


Download files

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

Source Distribution

MapColoniesJSONLogger-1.0.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

MapColoniesJSONLogger-1.0.0-py3-none-any.whl (2.9 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