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 1595375 - foreman-maintain does not rotate its log file
Summary: foreman-maintain does not rotate its log file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.3.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: Anurag Patel
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-26 19:04 UTC by Christian Marineau
Modified: 2018-06-28 13:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-27 06:57:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Christian Marineau 2018-06-26 19:04:13 UTC
Description of problem:
foreman-maintain keeps appending the same file /var/log/foreman-maintain/foreman-maintain.log every time it runs.

Version-Release number of selected component (if applicable):
6.3

How reproducible:
100%

Steps to Reproduce:
1. Run foreman-maintain multiple time
2. Verify the logs 
   # ls -lrt /var/log/foreman-maintain/


Actual results:
Only one file is present:
  /var/log/foreman-maintain/foreman-maintain.log

Expected results:
  Have a rotation at each run like satellite-installer does, which could look like this:
    /var/log/foreman-maintain/foreman-maintain.log
    /var/log/foreman-maintain/foreman-maintain.1.log
    /var/log/foreman-maintain/foreman-maintain.2.log

Additional info:
  While this has no technical impact on the functionality of the tool itself, it makes troubleshooting more fastidious. 

  When trying to determine when and why foreman-maintain encountered an error, we have to figure out the date which could be on different line.

  As an example, foreman-maintain could have failed on day 1 with error A, then succeed, then failed on day 3 with error B, then failed on day 4 with error C. Now we try to identify when it succeed and when/why it lastly failed to determine the proper fix, but the current log format adds unnecessary complexity.

Comment 1 Kavita 2018-06-27 06:57:01 UTC
Hi Christian,

Foreman maintain does log rotate.

Default file size set to 10000KB. 

Once file size reach to this limit, it will rotate the log file i.e creates backup log file for old logs - /var/log/foreman-maintain/foreman-maintain.log.0 

and continue logging into /var/log/foreman-maintain/foreman-maintain.log file.

You can modify this file size limit in /etc/foreman-maintain/foreman_maintain.yml using log_file_size option as per your requirement.

I would suggest you to try above configuration option & check log rotate. If you find any issue in this please feel free to reopen this ticket.

Comment 2 Christian Marineau 2018-06-27 15:36:23 UTC
(In reply to Kavita from comment #1)
> Hi Christian,
> 
> Foreman maintain does log rotate.
> 
> Default file size set to 10000KB. 
> 
> Once file size reach to this limit, it will rotate the log file i.e creates
> backup log file for old logs -
> /var/log/foreman-maintain/foreman-maintain.log.0 
> 
> and continue logging into /var/log/foreman-maintain/foreman-maintain.log
> file.
> 
> You can modify this file size limit in
> /etc/foreman-maintain/foreman_maintain.yml using log_file_size option as per
> your requirement.
> 
> I would suggest you to try above configuration option & check log rotate. If
> you find any issue in this please feel free to reopen this ticket.

Hi,

Thanks for your comment. Actually I was not accurate enough. What I wanted to highlight is the fact that the current log format is creating an unnecessary complexity. We are having case where we need to understand when and why foreman-maintain fails in the past. The same task done in the satellite-installer log is way easier since a new log file is create for every run. Then we can quickly know which run had an error and which ones were successful.

Was there a reason why we did not use the same kind of rotation for foreman-maintain? And would it be possible to verify the feasibility of this?

I also think that the BZ title may not be accurate, but the need is well explained in the description and the goal is to help support people to better identify future improvement of foreman-maintain.

Thanks.

Comment 3 Anurag Patel 2018-06-28 09:51:55 UTC
Hello Christian,

satellite-installer does have a rolling_file logger which is useful for that tool.

For foreman-maintain, however, we decided to rotate on filesize because satellite upgrade's heavy lifting is done by satellite-installer itself (invoked internally by f-m) and it already has a familiar logging structure in place.

In any case, we'll bring this topic for discussion internally and update here.

Anurag

Comment 4 Christian Marineau 2018-06-28 13:19:54 UTC
(In reply to Anurag Patel from comment #3)
> Hello Christian,
> 
> satellite-installer does have a rolling_file logger which is useful for that
> tool.
> 
> For foreman-maintain, however, we decided to rotate on filesize because
> satellite upgrade's heavy lifting is done by satellite-installer itself
> (invoked internally by f-m) and it already has a familiar logging structure
> in place.
> 
> In any case, we'll bring this topic for discussion internally and update
> here.
> 
> Anurag

Hi,

Thanks for your reply. Actually there are some additional steps like "yum update" and self-healing steps for known issue that can't be tracked via the satellite-installer. 

To give you a real-life example, please look at this KCS https://access.redhat.com/solutions/3497291

There are a lot of possible causes for the situation explained in the KCS and we would need to have a more efficient way to understand what is going on with foreman-maintain. Actually we basically need to search the entire file and figure out when the run was success and when it fails, and the current format is not helpful for support teams.

Thanks!

-Christian


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