Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Installation

pip install logmongo
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.

  • Logs newline separated STDIN JSON strings to MongoDB

Why should I use Logmongo instead of just pymongo?

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

By default a new Logmongo object will create a 512M named capped collection

write method which:

  • logs all passed keywords

  • if ‘when’ is not in record, add ‘when’ timestamp to log record

  • if ‘source’ is not in record, add ‘source’ add FQDN to log record

query method which:

  • allows keywords (kwargs) querying for example:

    log.query( tags='finance' )

tail method which:

  • prints all records to standard out which match the given query until killed

How does it work?

Example:

from logmongo import Logmongo

log = Logmongo('logs')

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 )

STDIN JSON to MongoDB

Example:

# tail the log collection
./logmongo --tail

# in another shell echo a JSON string into logmongo
echo '{"test":[143,435,432]}' | ./logmongo

# for more information
./logmongo --help

License

Public Domain

How do I thank you?

Write me an email! I always respond back!

Release files for logmongo 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logmongo 0.1.5
File Size Uploaded
logmongo-0.1.5.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for logmongo 0.1.5
File Interpreter ABI Platform
logmongo-0.1.5-py2.7.egg Legacy Egg format - - Details

Total release size: 8.7 kB

Release files / logmongo-0.1.5.tar.gz

Download URL logmongo-0.1.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a92063f4f091fab32449c17d561d4aeb0724ba88973a6c0720dd0cb569c78491
BLAKE2b-256 checksum
How to use checksums
e4afb338c892bd60ee106433265cbd35dbe08a4367611f4735a4219a1fed85b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / logmongo-0.1.5-py2.7.egg

Download URL logmongo-0.1.5-py2.7.egg
Size 5.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
d81a750c74868092bd430de34aa647c8d24234461b47485a24f64407d9da8769
BLAKE2b-256 checksum
How to use checksums
d7d47b72f61468a4af5fe0dec17ee8b61a0032174cbd8f3ea5ce238b48d10263
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page