[Python-bugs-list] [ python-Feature Requests-668905 ] logging module documentation

SourceForge.net noreply@sourceforge.net
Wed, 15 Jan 2003 21:07:28 -0800


Feature Requests item #668905, was opened at 2003-01-16 16:07
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=668905&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Jones (richard)
Assigned to: Nobody/Anonymous (nobody)
Summary: logging module documentation

Initial Comment:
I believe the logging module documentation needs to give an 
example of how to simply log to a file. The following example snippet 
could be appropriate: 
 
import logging 
logger = logging.getLogger('myapp') 
hdlr = FileHandler('/var/myapp/debug.log') 
hdlr.setFormatter(Formatter('%(asctime)s %(level)s %(message)s')) 
logger.addHandler(hdlr) 
logger.setLevel(DEBUG) 
 
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=668905&group_id=5470