I have the following handler configuration for logging:
"handlers": {
'system_file': {
'level': 'DEBUG',
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': os.path.join(LOG_FOLDER, "all.log"),
'formatter': 'verbose',
'when': 'midnight',
'backupCount': '30',
}
}
Run Code Online (Sandbox Code Playgroud)
Now based on this configuration my logs should get rotated every midnight, i.e it should create date wise logs.
In the all.log file, everything gets logged properly with correct timestamp, but when the rotation happens, I do not see all the logs in the backup log files (previous day log files).
For example: …