Bug 1133687
Summary: | File Input Module(imfile) does not continue logging when service is logrotated with the 'copytruncate' option | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | jstephen |
Component: | rsyslog | Assignee: | Jiří Vymazal <jvymazal> |
Status: | CLOSED ERRATA | QA Contact: | Stefan Dordevic <sdordevi> |
Severity: | high | Docs Contact: | Vladimír Slávik <vslavik> |
Priority: | high | ||
Version: | 7.2 | CC: | amuller, cww, gnaik, jkaur, jvymazal, mhaicman, mkolaja, nparmar, pablo.iranzo, pasik, pvrabec, qguo, rsroka, santony, sdordevi |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | rsyslog-8.24.0-6.el7 | Doc Type: | Known Issue |
Doc Text: |
Some log messages are lost when the *logrotate* "copytruncate" option is used with the *rsyslog* *imfile* module
When the *logrotate* utility with "copytruncate" option is rotating a log file, the *imfile* module of the *rsyslog* utility might not have read all of the log messages from the file being rotated. As a consequence, these log messages are lost. To work around this problem, do not use the "copytruncate" log rotation option. Alternatively, it is possible to lower the probability of message loss by using the experimental option "reopenOnTruncate=on".
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 09:53:51 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1313490 | ||
Bug Blocks: | 1298243, 1377248 |
Description
jstephen
2014-08-25 20:08:10 UTC
Actually, this is a known issue[0]. The v5 and (since el6.6) v7 versions don't support rotation of monitored files. This functionality was added upstream "recently", but only to the v8 branch. It _might_ be possible to backport it, but that would need more research. [0] http://lists.adiscon.net/pipermail/rsyslog/2013-June/033068.html Looks like the issue is with the 'copytruncate' option to logrotate. In the v5 version, the imfile plugin should support proper file rotation (renaming the current file and proceeding to write to a new one with the original name). I'm not familiar with Tomcat, but, theoretically, it should be possible to modify it (or write a script) to either do a proper rotation, or, instead of writing to catalina.out, pipe the logs to logger(1) or somesuch, or utilize some other input plugin other than imfile. Hello Tomas, Thanks for the input - do you have any skeleton wrapper-example that I could recommend to the customer as a possible workaround? Not at this point. I'm not familiar with Tomcat. Tested this with rsyslog v8 and not able to reproduce the tomcat issue anymore (catalina still logs after forced logrotate with above configuration options) *** Bug 1376459 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2306 |