Python logging handler for Logstash.
Project description
python-logstash
Python logging handler for Logstash.
Installation
Using pip:
pip install python-logstash
Using example
LogstashHandler is a custom logging handler which sends Logstash messages using UDP.
For example:
import logging
import logstash
test_logger = logging.getLogger('test_logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(logstash.LogstashHandler('localhost', 5959))
test_logger.info('Test logstash message.')
Using with Django
Modify your settings.py to integrate python-logstash with Django’s logging:
LOGGING = {
...
'handlers': {
'logstash': {
'level': 'DEBUG',
'class': 'logstash.LogstashHandler',
'host': 'localhost',
'port': 5959,
},
},
'loggers': {
'django.request': {
'handlers': ['logstash'],
'level': 'DEBUG',
'propagate': True,
},
},
...
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-logstash-0.1.2.tar.gz
(3.1 kB
view details)
File details
Details for the file python-logstash-0.1.2.tar.gz.
File metadata
- Download URL: python-logstash-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a214130f8080c6e92bc9c4361bb09a93a5a7c60e42a5046a748b74e9433ab292
|
|
| MD5 |
7bc5c817fb877b60e2840378d7e08961
|
|
| BLAKE2b-256 |
b8d5737ae2acfabb9d6110d9de89c5c5f31ce15af472b7f16d7627f56bd4267a
|