Skip to main content

Python logging handler that sends messages to Loggly

Project description

Pyhton Logging Loggly Handler
-----------------------------

A simple Pyhton logging Loggly handler that can be used to send to a Loggly gen 1 https endpoint. Borrowed the extra fields concept from the graypy logging library.

## Configuration

Excerpt for the json logging configuration.

{
"handlers": {
"loggly": {
"class": "loggly.handlers.HTTPSHandler",
"level": "INFO",
"url": "https://logs.loggly.com/inputs/MY-INPUT",
"facility": "my-app-name"
}
}
}

Adding the handler to a logger

logger = logging.getLogger(__name__)
handler = loggly.handlers.HTTPSHandler('https://logs.loggly.com/inputs/MY-INPUT')
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)

logger.info('sent to loggly')

Project details


Release history Release notifications

History Node

0.1.2

History Node

0.1.1

This version
History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
loggly-handler-0.1.0.tar.gz (2.0 kB) Copy SHA256 hash SHA256 Source None Mar 3, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page