Package: slowlog
OverviewTheslowloglibrary helps you find out why some requests to your
web application take a long time.  It periodically dumps stack traces
of long running requests to a log file.  It works as a Pyramid tween
or as a WSGI component. It is inspired byProducts.LongRequestLogger,
which provides similar functionality for Zope 2.This library can also log frame statistics to Graphite using theperfmetricslibrary, making it possible to create real-time graphs
that reveal expensive code paths.This library usessys._current_frames()to gather stack traces, so
it supports CPython versions 2.6+ and 3.2+, but other Python
implementations might not work.InstallationInstall using setuptools, e.g. (within a virtualenv):$ bin/easy_install slowlogPyramid ConfigurationOnce theslowloglibrary is installed, use theconfig.includemechanism to addslowlogto your project.  In your Pyramid
project’s__init__.py:config = Configurator(...)
config.include('slowlog')Alternately, you can add the following line to your application’s.inifile:pyramid.includes = slowlogNext, Pyramid needs some settings before theslowloglibrary has
any effect.  Two tweens are available,slowlogandframestats.The slowlog tweenTheslowlogtween periodically logs stack traces of long running
requests.  To activate it, setslowlog = truein your Pyramid settings.
Theslowlogtween supports the following settings.slowlogSet totrueto activate theslowlogtween.  Default: false.slowlog_timeoutOnly log stack traces of requests that last at least
this number of seconds (floating point).  Default: 2.0.slowlog_intervalOnce a request lasts longer thanslowlog_timeout, theslowlogtween continues to log stack traces periodically with
the given interval in seconds (floating point). Default: 1.0.slowlog_fileLog all stack traces to the given file.  The file will be rotated
automatically when it grows to 10 megabytes.  If this setting is empty or
missing, stack traces will be logged using Python’s standardloggingmodule with the logger nameslowlog.  Default: none.slowlog_framesLimit the number of frames in stack traces.  If set to 0, no stack
traces will be logged.  Default: 100.slowlog_hide_post_varsA whitespace-delimited list of POST variables that should be
redacted (hidden) in logs.  Useful for avoiding accidental storage
of cleartext passwords.  Default:password.The framestats tweenTheframestatstween periodically increments Statsd counters for
all frames on the stack of long-running requests.
To activate it, setframestats = truein your Pyramid settings.
Theframestatstween supports the following settings.framestatsSet totrueto activate theframestatstween.  Default: false.statsd_uriRequired.  A common URI isstatsd://localhost:8125.  See theperfmetricslibrary for supported parameters.framestats_timeoutOnly update Statsd for requests that last at least
this number of seconds (floating point).  Default: 2.0.framestats_intervalOnce a request lasts longer thanframestats_timeout, theframestatstween continues to update Statsd periodically with
the given interval in seconds (floating point). Default: 1.0.framestats_framesLimit the number of frames to follow in stack traces.
If set to 1, Statsd will receive information about only the current
frame.  Default: 100.CHANGES0.9 (2012-09-22)Initial release.