mozilla-services/heka-py — pull request #11 by crankycoder (2013-08-30 21:03:52+00:00)
Title: Features/heka stdliblogging

- I've moved the python standard logging output sender into the heka.streams namespace.
- The heka.senders namespace has finally been removed closing issue #4
- Updated the documentation to include example configuration for each stream type
- Added working examples using the INI configuration to the examples directory
- bumped revision to 0.30.2 (issue #9 required for marketplace)

The most significant change here is with how output to the stdlib logging module works.

The heka.streams.StdLibLogging stream *requires* the use of heka.encoders.StdlibJSONEncoder. In a nutshell, there is an mismatch between the streams API and what the python logging intefarce needs.

With the split in the heka client API between streams and encoding - the output stream only sees a write(msg) call. Python's logging interace requires a log level (int) and a string.

The StdlibJSONEncoder is identical to the JSONEncoder, except that is prepends a single byte to encode the log level. This changes the behavior of the output as we used to simply write out the payload to the python logger.

Changing the behavior from the previous version is not ideal, but I can't see why someone is using heka to write to the python logging as an output stream except for debugging purposes.