Skip to main content

DB-backed python logging.Handler subclass that uses kvlayer, and provides command-line tools.

Project description


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


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.



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')
dbhandler = DatabaseLogHandler(client, namespace)

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.


make test


To build the module:


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


- test rpm packge in a RPM platform.
- search from command line.
- 'tail -f' behavior for the log search interface.

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

dblogger-0.4.14.tar.gz (15.2 kB view hashes)

Uploaded source

Built Distribution

dblogger-0.4.14-py2.7.egg (33.6 kB view hashes)

Uploaded 2 7

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