Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/logloss #105

Merged
merged 3 commits into from
Nov 30, 2018
Merged

Bugfix/logloss #105

merged 3 commits into from
Nov 30, 2018

Conversation

codytipton
Copy link
Contributor

Make ConcurrentRotatingFileHandler the default in netuitive-agent.conf. 3rd of 3 PR's fixing Netuitive/netuitive-diamond#63

Do not merge until Netuitive/netuitive-diamond#93 merged into master.

codytipton added 3 commits November 29, 2018 16:07
For use in upcoming bugfix.  PR 1/3
Requires size based rotation instead of timed. Default prevents I/O
problems associated with multi-process logging to single file using
timedrotatingfilehandler.
Copy link
Contributor

@rclagett rclagett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What determines the filename of the old copies of logs? With the TimedRotatingFileHandler, a date was appended, which was always unique given rotation was time based.

@codytipton
Copy link
Contributor Author

/opt/netuitive-agent/embedded/lib/python2.7/concurrent_log_handler/init.py
@rclagett From init.py in concurrent_log_handler, in def doRollover(self)

        for i in range(self.backupCount - 1, 0, -1):
            sfn = "%s.%d" % (self.baseFilename, i)
            dfn = "%s.%d" % (self.baseFilename, i + 1)
            if os.path.exists(sfn + gzip_ext):
                do_rename(sfn, dfn)
        dfn = self.baseFilename + ".1"
        do_rename(tmpname, dfn)

at each rotation, the penultimate log will be, in our case, netuitive-agent.log.1. If netuitive-agent.log.1 existed prior to this rotation, that log will be moved (renamed) to netuitive-agent.log.2; while the most recently active log will take its place at netuitive-agent.log.1, and so on. The limit to backlogs is set in the config.

args = ('/opt/netuitive-agent/log/netuitive-agent.log', 'a', 512*1024, 5)

where the last argument, 5, is the upper limit.

@codytipton codytipton merged commit 934a295 into dev Nov 30, 2018
@codytipton codytipton deleted the bugfix/logloss branch November 30, 2018 17:37
@codytipton codytipton restored the bugfix/logloss branch December 3, 2018 13:16
@codytipton codytipton deleted the bugfix/logloss branch December 5, 2018 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants