This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add logging.shutdown() to python logging module example code
Type: Stage:
Components: Documentation Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: jimjjewett, manuel, vinay.sajip
Priority: normal Keywords:

Created on 2004-02-19 20:45 by manuel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg20063 - (view) Author: Manuel Schulte (manuel) Date: 2004-02-19 20:45
Hi There,

I was trying to get logging with the logging module
working using code from the example provided in section
6.28.8.1 in the documentation.  My log file was empty
after program execution completed.  I ended up adding
'logging.shutdown()' to the end of the example code to
finally see the results in the file ('hdlr.close()'
works as well).

cheers,
manuel




msg20064 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-02-20 20:26
Logged In: YES 
user_id=764593

Correct, but ...

With current code, you want to be sure that you don't call 
shutdown more than once.

With CVS code, you will no longer need to call shutdown 
manually.  So the doco change won't be needed either.

If you just want to hurry the results along, you can call 
hdlr.flush(), which still leaves the handler open for further use.
msg20065 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2004-02-21 22:21
Logged In: YES 
user_id=308438

Recent CVS changes will mean this bug is fixed, and as noted 
by Jim Jewett, documentation changes are not needed.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39955
2004-02-19 20:45:04manuelcreate