Simple logging change date format
examples/logging/simple_logging_date_format.py
import logging logging.basicConfig( format = '%(asctime)s %(levelname)-10s %(processName)s %(name)s %(message)s', datefmt = "%Y-%m-%d-%H-%M-%S") logging.debug("debug") logging.info("info") logging.warning("warning") logging.error("error") logging.critical("critical")
2020-04-22-18-59-16 WARNING MainProcess root warning 2020-04-22-18-59-16 ERROR MainProcess root error 2020-04-22-18-59-16 CRITICAL MainProcess root critical