On 09/22/2014 04:35 PM, Miloslav Trmač wrote:
>For example if you want to see just error messages in the journal you
>use "journalctl -p 3" or "journalctl -b -p 3" if you want it only from
>last boot ( add boot id if you want to from specific boot ) or you add
>"journalctl -b -p 3 -u httpd.service" if you want only the error
>messages for the apache daemon so fourth or so on.
Harald was saying that this is one of the things he wants to do but can’t because both the messages he wants and doesn’t want to record have the same priority.
You know as well as I do that we will not alter the priority label on
messages sent from the program based on administrators inability to come
up with filters in rsyslog. o_O
And for the record Harald is not using systemd journal he's using
rsyslog and he's complaining about unnecessary entries in
/var/log/messages which he could simply filter out all systemd related
messages out of /var/log/messages and into it's own file by adding this
entry to rsyslog.conf which you would not have to explain to a capable
administrators because he would have already consulted upstream
documentation how to achieve that.
":programname, isequal, "systemd" -/var/log/systemd.log"
or by more advanced rsyslog filter, which just filter the info message
from the systemd daemon to the log file systemd
"if $programname == 'systemd' and $syslogseverity <= '6'
/var/log/systemd.log"
And you can do a glorified mixing and matching if you so much like..
if ( $program contains "foobar" ) and ( $severity contains "err" ) then
/var/log/foobar.log
etc etc etc consult upstream documentation for further example...
In systemd journal this is not a problem...
By default systemd will show the end user 3 log entries for each cron
job that is run.
Two for the starting/startup of the session the user that is running the
job, to show if that succeeded or not and one for the actual cron job
being run
In this sample I'm telling the test cron job to echo the output into the
journal and associated it with the syslog identifier CROND while doing
so hence I have four entries.
# journalctl -f
Sep 22 11:13:01 localhost.localdomain systemd[1]: Starting Session 59 of
user johannbg.
Sep 22 11:13:01 localhost.localdomain systemd[1]: Started Session 59 of
user johannbg.
Sep 22 11:13:01 localhost.localdomain CROND[7336]: (johannbg) CMD
(/bin/systemd-cat -t "CROND" /bin/echo "Systemd journal cron job log
test every minute" )
Sep 22 11:13:01 localhost.localdomain CROND[7336]: Systemd journal cron
job log test every minute
Now if I dont want to see the systemd user session output I simply
filter it further by telling the journal only to give me the syslog
identifier for crond
# journalctl -f SYSLOG_IDENTIFIER=CROND
-- Logs begin at Thu 2013-10-24 11:47:22 GMT. --
Sep 22 11:14:01 localhost.localdomain CROND[7401]: (johannbg) CMD
(/bin/systemd-cat -t "CROND" /bin/echo "Systemd journal cron job log
test every minute" )
Sep 22 11:14:01 localhost.localdomain CROND[7401]: Systemd journal cron
job log test every minute
Two line just what I want no fuzz no muzz, no chasing after log files,
come up with complex filters and more time to the lazy admin I am and
drink my beer...
JBG
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct