Learn Python

 

ErrorLogging

Page history last edited by peter 2 yrs ago


 

It is complicated, because it can do *much* more than just write to file: emailing logs, logging to HTTP, TCP, UDP, SOAP servers, logging to Unix syslog and NT's event log.

 

BTW typical Java solution: does scale up but not down. In 2.4, basicConfig() scales down

 

Examples

 

Articles

Short overview

ONLamp (2005)

IBM devel (2007) extended logging: store in SQLite db for later comparison

 

Official docs

 

from author - API docs - config file format

 

Tips, best practices

 

  • use %r instead of %s or %d. if exceptions have been raised trying to log about an exception caused by incorrect data being passed in, e.g. string instead of a int. The repr form ensures that something sane will be logged

Comments (0)

You don't have permission to comment on this page.