pylons.log – Logging for WSGI errors

Logging related functionality

This logging Handler logs to environ['wsgi.errors'] as designated in PEP 333.

Module Contents

class pylons.log.WSGIErrorsHandler(cache=False, *args, **kwargs)

A handler class that writes logging records to environ[‘wsgi.errors’].

This code is derived from CherryPy’s cherrypy._cplogging.WSGIErrorHandler.

cache
Whether the wsgi.errors stream is cached (instead of looked up via pylons.request.environ per every logged message). Enabling this option is not recommended (particularly for the use case of logging to wsgi.errors outside of a request) as the behavior of a cached wsgi.errors stream is not strictly defined. In particular, mod_wsgi‘s wsgi.errors will raise an exception when used outside of a request.
emit(record)

Emit a record

flush()

Flushes the stream

get_wsgierrors()

Return the wsgi.errors stream

Raises a TypeError when outside of a web request (pylons.request is not setup)

Read the Docs v: v1.0.1rc1
Versions
latest
v1.0.1rc1
v0.9.7
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.