Package wsgitools :: Module filters :: Class RequestLogWSGIFilter
[hide private]
[frames] | no frames]

Class RequestLogWSGIFilter

source code


This filter logs all requests in the apache log file format.

Instance Methods [hide private]
 
__init__(self, log=<epydoc.docintrospecter._DevNull object>, flush=True)
This constructor does nothing and can safely be overwritten.
source code
{str: str}
filter_environ(self, environ)
BaseWSGIFilter interface
source code
str
filter_status(self, status)
BaseWSGIFilter interface
source code
bytes
filter_data(self, data)
For each string that is either written by the write callable or returned from the wrapped wsgi application this method is invoked.
source code
 
handle_close(self)
BaseWSGIFilter interface
source code

Inherited from BaseWSGIFilter: append_data, filter_exc_info, filter_header, filter_headers

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
creator(cls, log, flush=True)
Returns a function creating RequestLogWSGIFilters on given log file.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

creator(cls, log, flush=True)
Class Method

source code 

Returns a function creating RequestLogWSGIFilters on given log file. log has to be a file-like object.

Parameters:
  • log (file-like) - elements of type str are written to the log. That means in Py3.X the contents are decoded and in Py2.X the log is assumed to be encoded in latin1. This follows the spirit of WSGI.
  • flush (bool) - if True, invoke the flush method on log after each write invocation

__init__(self, log=<epydoc.docintrospecter._DevNull object>, flush=True)
(Constructor)

source code 

This constructor does nothing and can safely be overwritten. It is only listed here to document that it must be callable without additional parameters.

Parameters:
  • flush (bool) - if True, invoke the flush method on log after each write invocation
  • log (file-like)
Overrides: object.__init__

filter_environ(self, environ)

source code 

BaseWSGIFilter interface

Parameters:
  • environ ({str: str})
Returns: {str: str}
Overrides: BaseWSGIFilter.filter_environ

filter_status(self, status)

source code 

BaseWSGIFilter interface

Parameters:
  • status (str)
Returns: str
Overrides: BaseWSGIFilter.filter_status

filter_data(self, data)

source code 

For each string that is either written by the write callable or returned from the wrapped wsgi application this method is invoked. It must return a string.

Returns: bytes
Overrides: BaseWSGIFilter.filter_data
(inherited documentation)

handle_close(self)

source code 

BaseWSGIFilter interface

Overrides: BaseWSGIFilter.handle_close