Open justjew opened 3 years ago
set rotation for creating new log file at 00:00 every day set compression to zip old logs set format for more information in log file
rotation
compression
format
logger.add(f'{BASE_DIR}/logs/today.log', rotation='00:00', compression='tar.gz', format='{time:YYYY-MM-DD HH:mm} | {level} | {message} | {file.path}:{function}')
and change directory name to 'logs' in .gitignore
set
rotation
for creating new log file at 00:00 every day setcompression
to zip old logs setformat
for more information in log file