========
Provides two capabilities:
1) a subclass of python logging.Handler that stores logs using kvlayer
2) command line tools for searching through logs stored in kvlayer
Format
======
Logs are stored in kvlayer using the following format:
:key: UUID generated from the created field of the LogRecord class.
:value: JSON object with the LogRecord attributes except args and msg.
For more information have a look at Python LogRecord documentation.
http://docs.python.org/2/library/logging.html#logrecord-attributes
Usage
=====
Python
------
This is a small app in Python, an example of how to use dblogger.
import yaml
import logging
import kvlayer
from dblogger import DatabaseLogHandler, DBLoggerQuery
config = yaml.load(open("/myapp/config.yaml"))
client = kvlayer.client(config)
namespace = "myapp"
logger = logging.getLogger('mymodule')
logger.setLevel(logging.DEBUG)
dbhandler = DatabaseLogHandler(client, namespace)
logger.addHandler(dbhandler)
logger.warn("this is a demo msg")
Command Line
------------
After installing the python package, this command line entry point
will be available:
dblogger -c myconfig.yaml appname namespace loglevel filter
:filter: could be a regex to be applied to the log message or a field=regex pair,
specifying the log record field and the regex to be applied to that field.
Testing
=======
make test
Building
========
To build the module:
make
To create an egg package:
make build_egg
To create RPM packages:
make build_rpm
If you want to publish the package:
make register
and to clean everything:
make clean
TODO
====
- test rpm packge in a RPM platform.
- search from command line.
- 'tail -f' behavior for the log search interface.
Metadata
Release files for dblogger 0.4.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dblogger-0.4.14.tar.gz | 15.2 kB | Without provenance | Details for dblogger-0.4.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dblogger-0.4.14-py2.7.egg | Legacy Egg format | - | - | Details for dblogger-0.4.14-py2.7.egg |
Total release size: 48.8 kB
Release files / dblogger-0.4.14.tar.gz
| Download URL | dblogger-0.4.14.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f032727cc6c4b5ca6a89a69518afc7f4c0f23f8a93218a30f0bfdef4b764e946
|
|
BLAKE2b-256 checksum How to use checksums |
5765d3a22f7c6bc1bd7eaedc0191c77b8cef0b31ebd48d8d3d484610e72cb977
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / dblogger-0.4.14-py2.7.egg
| Download URL | dblogger-0.4.14-py2.7.egg |
|---|---|
| Size | 33.6 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
732da101039649591980f06e8de8dee0cbab212caa7f8570798d45daea82446f
|
|
BLAKE2b-256 checksum How to use checksums |
dda98b05d42a43666e958819d9ced01dc33477d4b51e6a3a00b2bf731792c02c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dblogger 0.4.14
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.