Skip to main content

YAML formatter for the standard Python logging module

Project description

travis_status

Overview

python-yaml-logger is a formatter for the standard Python logging module designed to allow formatting log data as YAML. Using YAML allow for both human- and machine-readable log files, and allows developers to quickly parse and make better use of log data.

Installation

Manual installation:

$ wget http://github.com/OldhamMade/python-yaml-logger/archive/master.tar.gz -O- | tar zx
$ cd python-yaml-logger-master
$ python setup.py install

Usage

import logging
import yamlformatter

logger = logging.getLogger()
logHandler = logging.FileHandler('my.yamllog')
formatter = yamlformatter.YAMLFormatter()
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)

Example output

- asctime: 2013-04-10 15:39:26,014
  created: 1365604766.014612
  levelname: INFO
  message: test message
  name: logger_name

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

python-yaml-logger-0.3.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file python-yaml-logger-0.3.1.tar.gz.

File metadata

File hashes

Hashes for python-yaml-logger-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ebee3766880894a71ed7599db6a93d562fea38f34391653c28d4578315fb8229
MD5 f5f6d1402c24fb7f5f003976d694b7be
BLAKE2b-256 aba3cca30a052312e4d72952d99edd5834e4f89b1a2fe2e7a94adc7ec1cd1b8b

See more details on using hashes here.

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