mike
mike

Reputation: 91

TimedRotatingFileHandler: Log only when detected time to rotate

I have a function that makes calls to a logger almost every second, however, I only want to log information an hour before the logfile rotates.

Upvotes: 0

Views: 271

Answers (1)

Mayank
Mayank

Reputation: 5569

Use logging.handlers.TimedRotatingFileHandler(filename, when='H', interval=1)

Upvotes: 1

Related Questions