Feature #27239
closedAdd timestamps to Foreman cron.log
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.
- 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
Updated by Eric Helms about 4 years ago
- Project changed from Foreman to Packaging
- Category deleted (
Logging)
Updated by The Foreman Bot about 4 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman-packaging/pull/5954 added
Updated by The Foreman Bot about 4 years ago
- Pull request https://github.com/theforeman/foreman-packaging/pull/5955 added
Updated by Eric Helms over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman-packaging|54edda2020b6acb881015cef798106daad668ff6.
Updated by The Foreman Bot almost 3 years ago
- Pull request https://github.com/theforeman/foreman-packaging/pull/7419 added
Updated by Ewoud Kohl van Wijngaarden almost 3 years ago
- Triaged changed from No to Yes
- Pull request deleted (
https://github.com/theforeman/foreman-packaging/pull/7419)
Updated by The Foreman Bot over 2 years ago
- Pull request https://github.com/theforeman/foreman-packaging/pull/7746 added
Updated by Ewoud Kohl van Wijngaarden over 2 years ago
- Pull request deleted (
https://github.com/theforeman/foreman-packaging/pull/7746)