GithubHelp home page GithubHelp logo

glowdigitalmedia / mongolog Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 132 KB

A drop in python logging module that logs messages from multiple hosts into a MongoDB collection

License: MIT License

Python 100.00%

mongolog's Introduction

MongoLog

Written by Harel Malka in 2010 as part of the Glow Machine (www.theglowmachine.com).

Adapted to generic use 2013 with permission.

[email protected] / [email protected]

MongoLog is a drop in replacement to a standard logging module where all log messages are kept in a mongodb collection. This allows many hosts to log into the same centralised location without messing about with file names.

The writes are not 'safe' by default to allow speedy log writes but setting SAFETY_LEVEL to the number of replica set members required for a safe save will ensure all saves are safe.

Default log level is DEBUG, which can be easily set to INFO/WARNING/ERROR from the settings block at the top of the page.

To log regardless of log level settings, use the 'any' method. Connections ot mongo are attempted first on a replica set client and fail to a single instance conncetion if no replica set is available. The connection is closed on the destruction of this object.

Usage:

from mongolog import MongoLog
LOG = MongoLog(logger="mylogger")
LOG.info("This is my informative message", mydetail="Some custom detail", anotherparam="another irrelevant informative parameter")
LOG.error("This is an error message", stack="Dump of stack trace")

mongolog's People

Contributors

harel avatar

Stargazers

Carlos Andrés Rocha avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.