Bug 1520502 - Candlepin keeps writing to rotated files and logrotate is unable to do its job
Summary: Candlepin keeps writing to rotated files and logrotate is unable to do its job
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: ojanus
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On: 1473349 1520499
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-04 15:23 UTC by Barnaby Court
Modified: 2019-03-04 15:14 UTC (History)
7 users (show)

Fixed In Version: candlepin-2.6.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1520499
Environment:
Last Closed: 2019-03-04 15:14:57 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 2213 0 'None' closed 1520502: Move to syslog/journald[ENT-397] 2020-08-03 12:14:11 UTC

Description Barnaby Court 2017-12-04 15:23:41 UTC
+++ This bug was initially created as a clone of Bug #1520499 +++
Cloning to fix in master

+++ This bug was initially created as a clone of Bug #1520357 +++

Hello,

logratating does not work for candlepin in Satellite 6.3. Although it might look like it's doing something, it is not working correctly. Log rotation must happen everyday on midnight, instead logs are only created when application is restarted. What's the problem is inability of reopening files when they are rotated - Candlepin carries on writing logs into deleted/renamed file until it is restarted. Then the correct file is appended again. This is a big problem when debugging customer calls as we end up with files of big sizes in our debug report or sos report.

Currently (Satellite 6.3) candlepin uses log4j/logstash with simple FileAppender and there is no way of telling it to reopen logs.

TRIAGE NOTES: Please do backport for us, create some simple way of telling the log4j stack to reopen logs (SIGHUP or HTTP endpoint) and use that in /etc/logrotate.d/candlepin file. Make sure it works under SELinux (logrotate runs confined and often cause problems).

SIDENOTE: Long term I recommend to consider using syslog/journad for all logs. This way, rotation is solved problem as it is provided by logging daemon "for free" (plus it enables sending logs over network - planned feature for future Satellite version). If you choose to use syslog for


Note You need to log in before you can comment on or make changes to this bug.