Project

General

Profile

Actions

Feature #27239

closed

Add timestamps to Foreman cron.log

Added by William Clark over 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Fixed in Releases:
Found in Releases:

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
Actions #1

Updated by Eric Helms over 3 years ago

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

Updated by The Foreman Bot over 3 years ago

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

Updated by The Foreman Bot over 3 years ago

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

Updated by The Foreman Bot almost 3 years ago

  • Fixed in Releases 2.5.0 added
Actions #5

Updated by Eric Helms almost 3 years ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by The Foreman Bot about 2 years ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/7419 added
Actions #7

Updated by Ewoud Kohl van Wijngaarden about 2 years ago

  • Triaged changed from No to Yes
  • Pull request deleted (https://github.com/theforeman/foreman-packaging/pull/7419)
Actions #8

Updated by The Foreman Bot almost 2 years ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/7746 added
Actions #9

Updated by Ewoud Kohl van Wijngaarden almost 2 years ago

  • Pull request deleted (https://github.com/theforeman/foreman-packaging/pull/7746)
Actions

Also available in: Atom PDF