Coder Social home page Coder Social logo

python-zeromq-log's Introduction

ZeroMQLog - A ZeroMQ Pub/Sub Logging Handler for Python

A logging handler for Python that publishes log messages using zeromq's pub/sub system. You can use this to read or respond to streaming log data in real time. If you are using sub-watcher then the messages can be redirected back to redis or syslog as needed with all sorts of filter goodness.

This project and it's layout and details were inspired by Jed Parsons and python-redis-log (currently hosted on GitHub).

Installation

The current stable release

pip install python-zeromq-log

or

easy_install python-zeromq-log

The latest from github

git clone git://github.com/rbucker881/python-zeromq-log.git
cd python-zeromq-log
python setup.py build
python setup.py install --prefix=$HOME  # for example

Requirements

Usage

>>> from zeromqlog import handlers, logger
>>> l = logger.ZeroMQLogger('my.logger')
>>> l.addHandler(handlers.ZeroMQHandler.to("my:channel"))
>>> l.info("I like chocolate cake")
>>> l.error("Belts?", exc_info=True)

ZeroMQ (rbucker881/sub-watcher) clients subscribed to my:channel will get a json log record like the following (sent from function foo() in file test.py:

{ username: 'richard',
  args: [],
  name: 'my.logger',
  level: 'info',
  line_no: 6,
  traceback: null,
  filename: 'qa.py',
  time: '2011-06-02T14:50:08.237052',
  msg: 'losing',
  funcname: 'bar',
  hostname: 'frosty.local' }

If an exception is raised, and exc_info is True, the log will include a formatted traceback in traceback.

The date is stored as an ISO 8601 string in GMT.

Contributors

Just in case you missed this at the top of the readme.

This project and it's layout and details were inspired by Jed Parsons and python-redis-log (currently hosted on GitHub).

python-zeromq-log's People

Contributors

rbucker avatar

Stargazers

A. Sebastian Dietzel avatar

Watchers

A. Sebastian Dietzel avatar James Cloos 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.