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

Alter log level for "removing file" messages #80

Closed
atc0005 opened this issue Oct 24, 2019 · 2 comments · Fixed by #81
Closed

Alter log level for "removing file" messages #80

atc0005 opened this issue Oct 24, 2019 · 2 comments · Fixed by #81
Assignees
Labels
bug Something isn't working logging
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Oct 24, 2019

Example output from a recent live run against a Tomcat 7 log directory:

INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-14.txt-20190615.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-15.txt-20190616.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-16.txt-20190617.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-17.txt-20190618.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-18.txt-20190619.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-19.txt-20190620.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-20.txt-20190621.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-21.txt-20190622.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-22.txt-20190623.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-23.txt-20190624.bz2 removal_enabled=true
INFO[0000] Removing file                                 file=/var/log/tomcat7/old/localhost_access_log.2019-06-24.txt-20190625.bz2 removal_enabled=true
INFO[0000] 1576 files successfully removed
INFO[0000] localhost_access_log.2015-04-23.txt-20160906.bz2  failed_removal=false
INFO[0000] localhost_access_log.2015-04-24.txt-20160906.bz2  failed_removal=false
INFO[0000] localhost_access_log.2015-04-25.txt-20160906.bz2  failed_removal=false
INFO[0000] localhost_access_log.2015-04-26.txt-20160906.bz2  failed_removal=false

I don't yet know the best way to handle listing/logging the latter items showing what did occur, but logging what was going to occur seems like duplicate information based on the default INFO log level.

A good first start here would be setting the former log messages to DEBUG level so that they're muted by default. The X files successfully removed message would explicitly remain INFO level and the latter messages better evaluated as part of the work on #72.

@atc0005 atc0005 added documentation Improvements or additions to documentation logging labels Oct 24, 2019
@atc0005 atc0005 added this to the v0.5.1 milestone Oct 24, 2019
@atc0005 atc0005 self-assigned this Oct 24, 2019
@atc0005
Copy link
Owner Author

atc0005 commented Oct 24, 2019

Note: Will likely need to update the example log output snippets and perhaps the screenshots as well.

atc0005 added a commit that referenced this issue Oct 24, 2019
Log messages are emitted BEFORE removing a file and
again AFTER. Change log level of the BEFORE messages
from INFO to DEBUG level in order to dedupe what is
shown at INFO level.

refs #80
@atc0005
Copy link
Owner Author

atc0005 commented Oct 24, 2019

Note: Will likely need to update the example log output snippets and perhaps the screenshots as well.

Those samples are not tied to an example that uses the --remove option, so those samples are fine as-is.

@atc0005 atc0005 added bug Something isn't working and removed documentation Improvements or additions to documentation labels Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant