Skip to main content

Python logging handler that sends messages to Loggly

Project description

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

[![Build Status](https://travis-ci.org/kennedyj/loggly-handler.png?branch=master)](https://travis-ci.org/kennedyj/loggly-handler) [![Coverage Status](https://coveralls.io/repos/kennedyj/loggly-handler/badge.png?branch=master)](https://coveralls.io/r/kennedyj/loggly-handler?branch=master)

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


Download files

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

Source Distribution

loggly-handler-0.1.1.tar.gz (2.0 kB view hashes)

Uploaded Source

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