Package: zilch
zilchzilchis a small library for recording and viewing exceptions from Python.
This library is inspired by (and uses several of the same functions from)
David Cramer’sSentry, but aims to implement just the core features in a
smaller code/feature footprint.RequirementssimplejsonWebErrorOptionalZeroMQ(For network based reporting)SQLAlchemy(For the database backend recorder)PyramidandWebHelpers(For the recorder web UI)Basic UsageReporting an ExceptionIn the application that wants to report errors, import zilch and configure
the reporter to record directly to the database:from zilch.store import SQLAlchemyStore
import zilch.client

zilch.client.store = SQLAlchemyStore('sqlite:///exceptions.db')Then to report an exception:from zilch.client import capture_exception
try:
    # do something that explodes
except Exception, e:
    capture_exception()The error will then be recorded in the database for later viewing.Advanced UsageIn larger cluster scenarios, or where latency is important, the reporting of
the exception can be handed off toZeroMQto be recorded to a central
recorder over the network. Both the client and recording machine must haveZeroMQinstalled.To setup the client for recording:import zilch.client

zilch.client.recorder_host = "tcp://localhost:5555"Then to report an exception:from zilch.client import capture_exception
try:
    # do something that explodes
except Exception, e:
    capture_exception()The exception will then be sent to the recorder_host listening at therecorder_hostspecified.Recording Exceptions CentrallyThe recorder usesZeroMQto record exception reports delivered over the
network. To run the recorder host, on the machine recording them run:>> zilch-recorder tcp://localhost:5555 sqlite:///exceptions.dbWithout aRecorderrunning,ZeroMQwill hold onto the messages until it
is available. After which point, it will begin to block (In the future, an
option will be added to configure the disk offloading of messages).The recorder will create the tables necessary on its initial launch.Viewing Recorded Exceptionszilchcomes with aPyramidweb application to view the database of
recorded exceptions. Once you have installedPyramidandWebHelpers, you can
run the web interface by typing:>> zilch-web sqlite:///exceptions.dbAdditional web configuration parameters are available to designate the
host/port that the web application should bind to (viewable by runningzilch-webwith the-hoption).Licensezilchis offered under the MIT license.Authorszilchis made available byBen Bangert.Supportzilch is considered feature-complete as the project owner (Ben Bangert) has
no additional functionality or development beyond bug fixes planned. Bugs can
be filed on github, should be accompanied by a test case to retain current
code coverage, and should be in a Pull request when ready to be accepted into
the zilch code-base.For a more full-featured error collector,Sentrynow has a stand-alone client
that no longer requires Django calledRaven.zilchwas created beforeRavenwas available, and the author now usesRavenrather thanzilchmost of the time.zilch0.1.3 (01/13/2012)FeaturesApplied pull request from Marius Gedminas to add prefix option support to the
error view webapp.0.1.2 (08/07/2011)Bug FixesCleanup session at end of request.0.1.1 (07/25/2011)Bug FixesFix bug with webob imports in client.py0.1 (07/25/2011)FeaturesException reporting via SQLAlchemy and/or ZeroMQRecording Store can be pluggableWSGI Middleware to capture exceptions with WSGI/CGI environment dataWeb User Interface for the recorder to view collected exceptionsEvent tagging to record additional information per exception such as the
Hostname, Application, etc.