On this page
logging.shutdown
Prev: logging.setLogRecordFactory | Up: logging | Next: logging.StreamHandler
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.shutdown
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import shutdown
Signature & Overview
logging.shutdown(handlerList=[<weakref at 0x10974cea0; to 'logging._StderrHandler' at 0x109740830>])
Perform any cleanup actions in the logging system (e.g. flushing buffers).
Usage
import logging
# Called automatically via atexit; flushes and closes all registered handlers
assert callable(logging.shutdown)
Gotchas
- Automatic on normal exit: You rarely need to call
logging.shutdown()manually unless flushing logs beforeos._exit()or reinitializing logging in tests.
REPL Inspect
from logging import shutdown
help(shutdown)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/setLogRecordFactory Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/StreamHandler Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/logging/addLevelName Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/basicConfig Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/BufferingFormatter Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/captureWarnings Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/critical shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/debug shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/disable shared tags: #logging, #stdlib