4

Fedora OS introduces journalctl as the new way to log error messages. I learn about this recently when I performed an upgrade. var/log/messages and many other log files are now combined into a .journal file within the var/log/journal directory.

I have a custom log that was created specially to log critical errors using the old rsyslog:

*.crit  /var/log/critical/log

This file will be emailed to me and rotated every hour using a cron job as long as there is an error. Now, how would this be done using journalctl? The options in journald.conf seems pretty limited. Do I still require rsyslog to do this?

2 Answers2

3

This command produces a similar output

journalctl --since="$(date '+%Y-%m-%d %H:%M:%S' -d '1 hour ago')" --priority=crit --quiet
Matthew Ife
  • 24,261
1

FWIW I've written a small program, journal-brief, to give a briefing of journal messages since the last time it was run.

https://github.com/twaugh/journal-brief

If you run it from cron (e.g. journal-brief -p err) you'll be mailed its output.

It bookmarks where it was up to by remembering the journal cursor, so it won't send duplicate log entries.