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 1716314 - foreman cron.log should contain timestamp
Summary: foreman cron.log should contain timestamp
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Packaging
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.10.0
Assignee: wclark
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-03 08:18 UTC by Steffen Froemer
Modified: 2021-11-16 14:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:08:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27239 0 Normal Ready For Testing Add timestamps to Foreman cron.log 2020-12-12 01:28:09 UTC
Red Hat Knowledge Base (Solution) 5296281 0 None None None 2020-08-05 05:22:41 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:08:40 UTC

Description Steffen Froemer 2019-06-03 08:18:23 UTC
Description of problem:
For better readability, the /var/log/foreman/cron.log should contain a valid timestamp

Version-Release number of selected component (if applicable):
foreman-1.20.1.34-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. su - foreman -s /bin/bash
2. run an example command from /etc/cron.d/foreman

  $ /usr/sbin/foreman-rake notifications:clean >>/var/log/foreman/cron.log 2>&1


Actual results:
Starting expired notifications clean up...
Finished, cleaned 0 notifications



Expected results:
[2019-06-03 10:15:52] Starting expired notifications clean up...
[2019-06-03 10:15:52] Finished, cleaned 0 notifications


Additional info:
As foreman-rake does not provide timestamp, it could be workarounded by adding an additional command to crontab

e.g.

# Clean expired notifications
0 6 * * 0       foreman    /usr/sbin/foreman-rake notifications:clean | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' >>/var/log/foreman/cron.log 2>&1

Comment 3 wclark 2019-07-04 13:40:59 UTC
Created Redmine

Comment 4 Bryan Kearney 2019-11-05 20:46:41 UTC
Upstream bug assigned to wclark

Comment 5 Bryan Kearney 2020-11-05 20:02:44 UTC
Upstream bug assigned to wclark

Comment 6 Bryan Kearney 2020-11-05 20:02:47 UTC
Upstream bug assigned to wclark

Comment 7 Bryan Kearney 2020-11-11 16:02:37 UTC
Upstream bug assigned to wclark

Comment 8 Bryan Kearney 2020-11-11 16:02:39 UTC
Upstream bug assigned to wclark

Comment 9 Bryan Kearney 2020-11-16 16:02:49 UTC
Upstream bug assigned to wclark

Comment 10 Bryan Kearney 2020-11-16 16:02:51 UTC
Upstream bug assigned to wclark

Comment 11 Bryan Kearney 2021-03-12 08:03:24 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/27239 has been resolved.

Comment 12 Lukas Pramuk 2021-07-27 19:49:11 UTC
VERIFIED.

@Satellite 6.10.0 Snap10.0
foreman-2.5.2-1.el7sat.noarch

by the following manual command:

# tail /var/log/foreman/cron.log
[2021-07-27 14:30:17] 'ErbParser' is ignored.
[2021-07-27 14:30:17] 'RubyParser' is ignored.
[2021-07-27 15:00:03] `/usr/share/foreman` is not writable.
[2021-07-27 15:00:03] Bundler will use `/tmp/bundler20210727-65313-g1dxc965313' as your home directory temporarily.
[2021-07-27 15:00:16] 'ErbParser' is ignored.
[2021-07-27 15:00:16] 'RubyParser' is ignored.
[2021-07-27 15:30:04] `/usr/share/foreman` is not writable.
[2021-07-27 15:30:04] Bundler will use `/tmp/bundler20210727-65657-hq8muq65657' as your home directory temporarily.
[2021-07-27 15:30:17] 'ErbParser' is ignored.
[2021-07-27 15:30:17] 'RubyParser' is ignored.

>>> /var/log/foreman/cron.log now contains only entries with timestamp

Comment 15 errata-xmlrpc 2021-11-16 14:08:28 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 (Moderate: Satellite 6.10 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-2021:4702


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