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
Rotate log files based on size #2964
Comments
Rotation of log files when the file reaches a size limit. Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
Corrected unsed variable error. Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
Correcte identation Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
Identation Corrected. Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
Rotation of log files when the file reaches a size limit. Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
Corrected identation. Signed-off-by: Alexandre Santos <alexandre.rosas.santos@gmail.com>
HI @amdrsantos We are trying similar patch for log roatation . however we are facing issue for the new option size_limit Observation is new options added in modules/affile/affile-grammar.ym or modules/affile/affile-grammar.y files |
Hi @sudheerreddys, |
Thanks @amdrsantos Hi @shikharvashistha Please help on this |
Hi , |
@sudheerreddys Executing Please note that whenever a
That is correct, we have some initial work on this feature with Shikhar. It can be publicly followed in my fork, but it is currently far from a working prototype. For example, MrAnno#17 |
Thanks @MrAnno you are reply . Yes i have added new option in the .ym file after compile i have seen in .y its automatically adding new option please see the below size_lmit option i have added getting the below error when run syslog bin
|
@MrAnno please help on above one .this for new option under destination affile for .conf |
Description of the problem
When using the logrotate with common configuration, log entries can be lost between the time in which the logrotate copies the file and the truncate of the file.
Proposed solution
I suggest to rotate the log within syslog-ng based in a file size limit configuration parameter. Additionally one parameter with the desired suffix can be added.
I try was already done in https://github.com/pld-linux/syslog-ng/blob/master/log-file-size-limit.patch
Alternatives
Add a disk buffer and reliable properties in syslog-ng configuration for each log file, and configure in logrotate the restart of syslog-ng in the end of each rotation. This solution has the disadvantage of periodically have to restart the syslog-ng. Potentially it can be too many restarts of syslog-ng depending on number of logs, size limits, and events recorded.
Additional context
Already have a patch ready
The text was updated successfully, but these errors were encountered: