Package logging :: Module handlers :: Class HTTPHandler
[show private | hide private]
[frames | no frames]

Class HTTPHandler

Filterer --+    
           |    
     Handler --+
               |
              HTTPHandler


A class which sends records to a Web server, using either GET or POST semantics.
Method Summary
  __init__(self, host, url, method)
Initialize the instance with the host, the request URL, and the method ("GET" or "POST")
  emit(self, record)
Emit a record.
  mapLogRecord(self, record)
Default implementation of mapping the log record into a dict that is sent as the CGI data.
    Inherited from Handler
  acquire(self)
Acquire the I/O thread lock.
  close(self)
Tidy up any resources used by the handler.
  createLock(self)
Acquire a thread lock for serializing access to the underlying I/O.
  flush(self)
Ensure all logging output has been flushed.
  format(self, record)
Format the specified record.
  handle(self, record)
Conditionally emit the specified logging record.
  handleError(self, record)
Handle errors which occur during an emit() call.
  release(self)
Release the I/O thread lock.
  setFormatter(self, fmt)
Set the formatter for this handler.
  setLevel(self, level)
Set the logging level of this handler.
    Inherited from Filterer
  addFilter(self, filter)
Add the specified filter to this handler.
  filter(self, record)
Determine if a record is loggable by consulting all the filters.
  removeFilter(self, filter)
Remove the specified filter from this handler.

Method Details

__init__(self, host, url, method='GET')
(Constructor)

Initialize the instance with the host, the request URL, and the method ("GET" or "POST")
Overrides:
logging.Handler.__init__

emit(self, record)

Emit a record.

Send the record to the Web server as an URL-encoded dictionary
Overrides:
logging.Handler.emit

mapLogRecord(self, record)

Default implementation of mapping the log record into a dict that is sent as the CGI data. Overwrite in your class. Contributed by Franz Glasner.