Switch to filewwatcher logger

Don't use koji's logrotate and let system handle it.

Related: https://pagure.io/koji/issue/3392
This commit is contained in:
Tomas Kopecek 2023-06-12 14:56:48 +02:00
parent 7f8c75d941
commit 9b48b9c01d

View file

@ -3935,7 +3935,7 @@ def add_file_logger(logger, fn):
return
if not os.access(fn, os.W_OK):
return
handler = logging.handlers.RotatingFileHandler(fn, maxBytes=1024 * 1024 * 10, backupCount=5)
handler = logging.handlers.WatchedFileHandler(fn)
handler.setFormatter(logging.Formatter('%(asctime)s [%(levelname)s] %(name)s: %(message)s'))
logging.getLogger(logger).addHandler(handler)