Am 22.09.2014 um 19:37 schrieb Jóhann B. Guðmundsson: > > 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" i already explained why this is a bad idea > 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 who told you that this also don't flter out relevant messages? on a non-debugging system that entries should not be created at all - done properly and not blow debug infos on non debug machines and there is nothing which needs to be filtered > 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... fix it at the root cause don't create a ton of entries for each starting cronjob * nobody but systemd-developers needs them as default * crond worked before some systemd developers learnd to speak > In systemd journal this is not a problem... it is a problem, independent how often you pretend the opposite * only if it grows endlessly * on rsyslog systems it limits the ability of "systemctl status" to show recent logs from the daemon because it get rotatet or you need to waste ressources multiple times * on embedded devices it will always be a problem > By default systemd will show the end user 3 log entries for each cron job that is run. and by only log started / finished with a clear prefix until there was an error it could show the whole day wait - that info is logged by crond itself already > 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 boah i am talking about the crap below forcing you to enbale linger to get rid of triggering another systemd bug on several machines leading to hang at shutdown for some minutes - nice on production servers! Mar 4 12:57:34 rawhide systemd[1]: Stopping User Manager for UID 0... Mar 4 12:57:34 rawhide systemd[1482]: Stopping Default. Mar 4 12:57:34 rawhide systemd[1482]: Stopped target Default. Mar 4 12:57:34 rawhide systemd[1482]: Stopping Basic System. Mar 4 12:57:34 rawhide systemd[1482]: Stopped target Basic System. Mar 4 12:57:34 rawhide systemd[1482]: Stopping Paths. Mar 4 12:57:34 rawhide systemd[1482]: Stopped target Paths. Mar 4 12:57:34 rawhide systemd[1482]: Stopping Timers. Mar 4 12:57:34 rawhide systemd[1482]: Stopped target Timers. Mar 4 12:57:34 rawhide systemd[1482]: Stopping Sockets. Mar 4 12:57:34 rawhide systemd[1482]: Stopped target Sockets. Mar 4 12:57:34 rawhide systemd[1482]: Starting Shutdown. Mar 4 12:57:34 rawhide systemd[1482]: Reached target Shutdown. Mar 4 12:57:34 rawhide systemd[1482]: Starting Exit the Session... Mar 4 12:57:34 rawhide systemd[1482]: Received SIGRTMIN+24 from PID 1551 (kill). Mar 4 12:57:34 rawhide systemd[1]: Stopped User Manager for UID 0. Mar 4 12:57:34 rawhide systemd[1]: Stopping user-0.slice. Mar 4 12:57:34 rawhide systemd[1]: Removed slice user-0.slice. Mar 4 13:01:01 rawhide systemd[1]: Starting user-0.slice. Mar 4 13:01:01 rawhide systemd[1]: Created slice user-0.slice. Mar 4 13:01:01 rawhide systemd[1]: Starting User Manager for UID 0... Mar 4 13:01:01 rawhide systemd[1559]: Starting Paths. Mar 4 13:01:01 rawhide systemd[1559]: Reached target Paths. Mar 4 13:01:01 rawhide systemd[1559]: Starting Timers. Mar 4 13:01:01 rawhide systemd[1559]: Reached target Timers. Mar 4 13:01:01 rawhide systemd[1559]: Starting Sockets. Mar 4 13:01:01 rawhide systemd[1559]: Reached target Sockets. Mar 4 13:01:01 rawhide systemd[1559]: Starting Basic System. Mar 4 13:01:01 rawhide systemd[1559]: Reached target Basic System. Mar 4 13:01:01 rawhide systemd[1559]: Starting Default. Mar 4 13:01:01 rawhide systemd[1559]: Reached target Default. Mar 4 13:01:01 rawhide systemd[1559]: Startup finished in 9ms. Mar 4 13:01:01 rawhide systemd[1]: Started User Manager for UID 0. Mar 4 13:01:01 rawhide systemd[1]: Stopping User Manager for UID 0... Mar 4 13:01:01 rawhide systemd[1559]: Stopping Default. Mar 4 13:01:01 rawhide systemd[1559]: Stopped target Default. Mar 4 13:01:01 rawhide systemd[1559]: Stopping Basic System. Mar 4 13:01:01 rawhide systemd[1559]: Stopped target Basic > # 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... if you would only click on the links somebody provides before abuse users, Fedora and Fesco as you did with your first reply on the systemd-list which was the reason for cross-posting
Attachment:
signature.asc
Description: OpenPGP digital signature
-- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct