Skip to content

Log rotation failure originating from fancylogger #252

@holstgr-kaust

Description

@holstgr-kaust

The log rotation functionality in fancylogger appears to be broken. When log files are rotated, the existing writer ends up with a stale file handle.

For example, this appears as a log rotation failure issue in EasyBuild:
easybuilders/easybuild-framework#1094

Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/handlers.py", line 77, in emit
    self.doRollover()
  File "/usr/lib64/python2.7/logging/handlers.py", line 140, in doRollover
    os.rename(self.baseFilename, dfn)
OSError: [Errno 13] Permission denied

Changing line:

178: MAX_BYTES = 100 * 1024 * 1024 # max bytes in a file with rotating file handler```

to:

178: MAX_BYTES = 0

Is a hacky, but effective fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions