Skip to main content

logstashHandler

logstashHandler is a basic logging handler for sending to a logstash instance via UDP or TCP encoded as json.

Basic usage

Setup an input on the relevant logstash server:

input {
  udp {
    port => 12345
    codec => json
  }
}

Setup handler and ship logs:

python
from logstashHandler import logstashHandler

lhandler = logstashHandler(host='mylogserver.example.com',port=12345,proto='UDP')
logger.addHandler(lhandler)
logger.warn("Something went wrong")

To send additional fields to logstash, use the keyword extra and send a dict starting with extraFields:

logger.warn('DANGER DANGER',extra={'extraFields':{'name':'W. Robinsson', 'planet':'Unkown'}})

The default level field name and individual level names can be overridden as so:

levels = {'ERROR': 3, 'WARNING': 2, 'INFO': 1, 'DEBUG': 0}
lhandler = logstashHandler(
    host='mylogserver.example.com',
    port=12345,
    proto='UDP',
    levels=levels,
    levelLabel='severity'
)

More info can be found on the github page.

Metadata

Release files for logstashHandler 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logstashHandler 0.1.4
File Size Uploaded Provenance Actions
logstashHandler-0.1.4.tar.gz 2.3 kB Without provenance Details for logstashHandler-0.1.4.tar.gz

Release files / logstashHandler-0.1.4.tar.gz

Download URL logstashHandler-0.1.4.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
23e0cb46a813a07d15041174824d0135bda891d54fdbb783337995e9633cc40d
BLAKE2b-256 checksum
How to use checksums
ea3b285219d3164a097763bd480f7fc8de2b00870ac7cb0eb37c254b0074c1ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for logstashHandler 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page