Skip to main content

Elasticsearch Log handler for the logging library

Project description

eslogging

This is a fork of CMRESHandler.py project. We didn't contribute to it as there's no maintenance of that project anymore.

Python Elasticsearch Log handler


This library provides an Elasticsearch logging appender compatible with the

python standard logging <https://docs.python.org/2/library/logging.html>_ library.

The code source is in github at `https://github.com/cmanaha/python-elasticsearch-logger

https://github.com/cmanaha/python-elasticsearch-logger`_

Installation

============

Install using pip::

pip install eslogging

Requirements Python 3

=====================

This library requires the following dependencies

  • elasticsearch

  • requests

Additional requirements for Kerberos support

============================================

Additionally, the package support optionally kerberos authentication by adding the following dependecy

  • requests-kerberos

Additional requirements for AWS IAM user authentication (request signing)

=========================================================================

Additionally, the package support optionally AWS IAM user authentication by adding the following dependecy

  • requests-aws4auth

Building the sources & Testing


To create the package follow the standard python setup.py to compile.

To test, just execute the python tests within the test folder

Why using an appender rather than logstash or beats


In some cases is quite useful to provide all the information available within the LogRecords as it contains

things such as exception information, the method, file, log line where the log was generated.

If you are interested on understanding more about the differences between the agent vs handler

approach, I'd suggest reading this conversation thread <https://github.com/cmanaha/python-elasticsearch-logger/issues/44/>_

The same functionality can be implemented in many other different ways. For example, consider the integration

using SysLogHandler <https://docs.python.org/3/library/logging.handlers.html#sysloghandler>_ and

logstash syslog plugin <https://www.elastic.co/guide/en/logstash/current/plugins-inputs-syslog.html>_.

Contributing back


Feel free to use this as is or even better, feel free to fork and send your pull requests over.

build Status

downloads

license

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

eslogging-1.0.8-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file eslogging-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: eslogging-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13

File hashes

Hashes for eslogging-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9857782f4e2ab0fda347c4d4361b6a185b4ac9179fd0bf2658a008a64b1d830f
MD5 c9ce2af15215a8cd7802b00d29814bd7
BLAKE2b-256 224088698da130ce079a7a70c42d8621872e3a8c0ce8a6cbe476f6761d94526c

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