0

I have created a log with timedrotatingfilehandler (). And my scenario is it will log 30 minutes once. but every 30 mins while logging , the log file gets overwritten instead of appending to old logged ones.

logHandler = handlers.TimedRotatingFileHandler(log_file, when='D', interval=1, backupCount=1)

Is my syntax is right?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
  • Welcome to SO. You need to provide a [mre] and debugging details. You created a rotating handler of interval one day. The log file will not be overwritten until the next rotation(next day). So you did something wrong in some other place of your code. – relent95 Dec 14 '22 at 15:04

0 Answers0