Skip to main content

Log handler meant for logstash

Project description

This library is provided to allow standard python logging to stream JSON logs to logstash.

Installing

Pip:

pip install logstash_handler

Pypi:

https://pypi.python.org/pypi/logstash_handler

Manual:

python setup.py install

Usage

Json outputs are provided by the LogstashFormatter logging formatter.

import logging
from logstash_formatter import LogstashFormatter
from logstash_handler import LogstashHandler

logger = logging.getLogger()
handler = LogstashHandler('localhost', 5000, ssl=False)
formatter = LogstashFormatter()

handler.setFormatter(formatter)
logger.addHandler(handler)

The LogstashHandler takes the following named parameters:

  • host: host to connect to

  • port: host to connect to

  • ssl: boolean indicating if the stream should be encrypted. Default is True

  • keyfile: The path to the encrypting key

  • certfile: The path to the encrypting certificate

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

logstash_handler-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file logstash_handler-0.1.0.tar.gz.

File metadata

File hashes

Hashes for logstash_handler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4674773405a8a9098b1061668a6265c8c52d736ad71dd93d222c9cbbf6b4087
MD5 1cfe11ce07bc7b86c8b619c719fc19f0
BLAKE2b-256 1bb55b7c631365bd09a90b86ec9b69efafd20b96882b8d693913ca39da1c7ee0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page