-
Notifications
You must be signed in to change notification settings - Fork 2
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
create settings to rotate service.log #11
Conversation
# services.log | ||
# | ||
log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender | ||
log4j.appender.rollingFile.File=$/var/log/rundeck/service.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weslleycamilo the commit was pushed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of log file configurations below:
rundeck.jobs.log
, rundeck.api.log
,rundeck.access.log
etc.
log4j.appender.rollingFile.File=$/var/log/rundeck/service.log | ||
log4j.appender.rollingFile.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.rollingFile.layout.ConversionPattern=%d{ISO8601} - %m%n | ||
log4j.appender.rollingFile.MaxFileSize=10MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice parametrize log4j.appender.rollingFile.MaxFileSize
and log4j.appender.rollingFile.MaxBackupIndex
. We can change these values in the future, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about 200mb rotating for each 7 days as default values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well there is just two parameters like this which one I've updated and another one inserted.. So I'm gonna make some tests before to see if it works fine, but one ideia I had is to unify all the settings in the max of two settings and put rundeck.* to work with all the logs.
- It will make more simple
- It is logs which with your suggestion of 7 days of retention it would be enough for all the logs.
- It will make possible to rotate all the logs
So as you said it's tests might will be boring as I've to restart rundeck, so I'm gonna do its first test and make sure it works to go on to the next steps.
what do you think @raphapr ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you r saying but I'm afraid that violate the principle of ansible roles. A user may want to configure any log file through the role parameters, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeaah he will still be able to do that man.. right ? my proposal is to simplify the actual configs to all related logs. rundeck.jobs.log
, rundeck.api.log
,rundeck.access.log
etc.
so if anyone wants to create a new one it will be possible to create.
Anyway I don't know if it is possible and I am just gonna give it a try.
@mtulio 2017? good memory 🤣 |
Doc which I've based on: https://howtodoinjava.com/log4j/log4j-rolling-file-appender/
https://stackoverflow.com/questions/1050256/how-can-i-get-log4j-to-delete-old-rotating-log-files
https://www.baeldung.com/java-logging-rolling-file-appenders