PR#3537: Switch to WatchedFileHandler for logger
Merges #3537 https://pagure.io/koji/pull-request/3537 Fixes: #3392 https://pagure.io/koji/issue/3392 kojid/kojira logging does not play nice with logrotate
This commit is contained in:
commit
37d9b5f4cd
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue