Project

General

Profile

Feature #27239

Add timestamps to Foreman cron.log

Added by William Clark almost 2 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-

Description

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 worked around by adding an additional command to crontab

e.g.

  1. 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

Associated revisions

Revision 35feebb1 (diff)
Added by Eric Helms 5 months ago

Refs #27239: Add timestamps to cron actions in Foreman

Revision 54edda20 (diff)
Added by Eric Helms 3 months ago

Fixes #27239: Add timestamps to cron actions in Foreman

History

#1 Updated by Eric Helms 8 months ago

  • Category deleted (Logging)
  • Project changed from Foreman to Packaging

#2 Updated by The Foreman Bot 8 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-packaging/pull/5954 added

#3 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/5955 added

#4 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 2.5.0 added

#5 Updated by Eric Helms 3 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF