This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description
dblogger
========

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.
Release History

Release History

This version
History Node

0.4.14

History Node

0.4.13

History Node

0.4.12

History Node

0.4.12.dev2

History Node

0.4.12.dev1

History Node

0.4.11

History Node

0.4.11.dev3

History Node

0.4.11.dev2

History Node

0.4.11.dev1

History Node

0.4.10

History Node

0.4.9

History Node

0.4.8

History Node

0.4.7

History Node

0.4.6

History Node

0.4.5

History Node

0.4.3.dev4

History Node

0.4.3.dev3

History Node

0.4.1

History Node

0.4.0

History Node

0.3.2.dev2

History Node

0.3.1

History Node

0.3.1.dev10

History Node

0.3.1.dev9

History Node

0.3.1.dev8

History Node

0.3.1.dev7

History Node

0.2.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dblogger-0.4.14-py2.7.egg (33.6 kB) Copy SHA256 Checksum SHA256 2.7 Egg Apr 26, 2015
dblogger-0.4.14.tar.gz (15.2 kB) Copy SHA256 Checksum SHA256 Source Apr 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting