skip to navigation
skip to content

logmongo 0.0.3

Logmongo: Log messages to a capped MongoDB collections

Latest Version: 0.1.5

Installation

easy_install logmongo

What does it do?

  • Gracefully creates capped collections.
  • Auto expires oldest records first and solves log rotation.
  • Writes complex (dicts and kwargs) log records.
  • Logs asynchronously.
  • Collects logs locally or remotely or in a central location.
  • Allows access to logs via MongoDB queries and APIs.

Why should I use Logmongo instead of just pymongo?

Logmongo subclasses the pymongo Collection object and provides the following additions -

A new Logmongo object will:
  • gracefully create a named capped collection
  • allow a max size to be specified
write method which:
  • logs all passed keywords
  • adds current time to record
  • adds hostname to record
query method which:
  • allows keywords (kwargs) querying example: log.query( tags=’finance’ )
tail method which:
  • prints all records that match query until killed

How does it work?

Example:

from logmongo import Logmongo

log = Logmongo()

log.write( message='No required kwargs or fields!' )

entry = {
  'tags':['but','we','like','tags'],
  'level':'info'
}
log.write( entry )

# for more help check out
help( logmongo )

License

Public Domain

How do I thank you?

Write me an email! I always respond back!

 
File Type Py Version Uploaded on Size
logmongo-0.0.3-py2.7.egg (md5) Python Egg 2.7 2012-07-14 4KB
logmongo-0.0.3.tar.gz (md5) Source 2012-07-14 2KB