Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1787456 - [RFE] Candlepin log rotation settings should be user-configurable
Summary: [RFE] Candlepin log rotation settings should be user-configurable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.6.0
Hardware: All
OS: Linux
high
high
Target Milestone: 6.13.0
Assignee: candlepin-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On: 2112308
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-02 22:45 UTC by patalber
Modified: 2023-10-06 18:58 UTC (History)
9 users (show)

Fixed In Version: candlepin-4.2.8-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2112308 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:20:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ENT-5300 0 None None None 2022-07-29 10:08:18 UTC
Red Hat Issue Tracker SAT-15920 0 None None None 2023-02-16 10:08:47 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:20:49 UTC

Description patalber 2020-01-02 22:45:12 UTC
1. Proposed title of this feature request  
  Candlepin log rotation settings should be user-configurable
2. What are the nature and description of the request?  
  The default settings for candlepin log rotation are too relaxed for large/busy Satellites.  As a user, I would like to be able to change the MAX_HISTORY value and that value should persist after an upgrade.
  The settings are defined in the file: /var/lib/tomcat/webapps/candlepin/WEB-INF/classes/logback.xml 
  This file is a part of the candlepin RPM, and it is not marked as a config file, so any user changes will be overwritten on RPM upgrades
  
3. Why does your organization need this? (List the business requirements here)  
  On a large/busy Satellite, 52 days of candlepin logs take up 18Gb+ of disk space. It is exceedingly unlikely to need to access logs going back this far, so the disk space is largely wasted.  This causes operational issues with filesystems filling up and impacting other parts of the Satellite server.

4. How would you like to achieve this? (List the functional requirements here)  
  Option 1: Set the logback.xml file as a noreplace-configfile in the candlepin rpm spec
  Option 2: Add an option to the satellite-installer to set the desired values
  Option 3: Any other solution that would allow a user to configure the log rotation settings for candlepin logs to persist between upgrades
  
5. For each functional requirement listed, specify how Red Hat and your organization can test to confirm the requirement is successfully implemented.  
  Make a user-defined change to the default log rotation configurations
  Validate the new setting is effective by monitoring the number of log files retained after a log rotation occurs (if changing MAX_HISTORY)
  Validate the new setting persists after an upgrade/reinstall of the candlepin RPM

6. Is there already an existing RFE upstream or in Red Hat Bugzilla?  
  No
  
7. Do you have any specific timeline dependencies and which release would they like to target (i.e. Sat 6.7, RHEL8.1)?  
  As soon as it is feasible. This becomes an operational issue for us every few weeks as we manually clean old log files

8. List any affected packages or components.  
  candlepin-2.6.9-1.el7sat.noarch

9. Would your organization be able to assist in testing this functionality if implemented?"
  Yes

Comment 4 Chris Snyder 2020-01-09 16:16:01 UTC
Would we rather implement this as requested or implement the option to have candlepin log to journalctl or rsyslog?

Comment 5 patalber 2020-01-10 16:33:03 UTC
Chris,

I will take this back to the customer and ask. As stated, it appears that they would like the option of configuring this via the installer, but they may change their minds if it is logged via journalctl or rsyslog.

Thank you for the response.

--Patrick

Comment 6 patalber 2020-01-14 15:35:25 UTC
Hi Chris,

Here is the response from the customer:

"I'm pretty un-opinionated about the mechanism that handles the log rotation.  Just glancing at the history, it looks like it was originally in logrotate then moved to logback.  As long as we can get some control over tuning the log retention policy I think it will satisfy our needs."

Looks like the method isn't as important to them as being able to control tuning of the log retention policy.

Thanks!

--Patrick

Comment 9 Mike McCune 2022-07-08 17:15:31 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 13 Vladimír Sedmík 2023-02-16 10:07:54 UTC
Verified in Satellite 6.13.0 snap 10 (candlepin-4.2.13-1.el8sat.noarch):

Option 1 (Set the logback.xml file as a noreplace-configfile in the candlepin rpm spec) was implemented as solution.

Steps to verify:
1) Downgraded candlepin to 4.1.19-1.el8sat
2) In /var/lib/tomcat/webapps/candlepin/WEB-INF/classes/logback.xml, changed the MAX_HISTORY value to 1.
3) Upgraded candlepin back to 4.2.13-1.el8sat
4) Checked the MAX_HISTORY value persisted.
5) Verified that after next logrotate no candlepin logs older than MAX_HISTORY remained in /var/log/candlepin/

Note: For more information how to set rotation of the other logs (audit.log and error.log) see https://access.redhat.com/solutions/4741091

Comment 16 errata-xmlrpc 2023-05-03 13:20:29 UTC
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 (Important: Satellite 6.13 Release), 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/RHSA-2023:2097


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