]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler/log.c: Use `[Job N]` even for syslog
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 19 Mar 2021 08:25:41 +0000 (09:25 +0100)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 25 Mar 2021 15:00:40 +0000 (11:00 -0400)
commitd8c283ce739580eceaf9afa3978dd0e409a81ca9
treea8a2f6c341f2751892bdd9c5afc559fdc371cecf
parent1a141d8bb6db373ab33b4b7f15be83dd9045d2c1
scheduler/log.c: Use `[Job N]` even for syslog

Currently there is a difference in job log format based on where logs
are sent - the message contains `[Job N]` if sent to a file and it
doesn't contain the string if sent to syslog.
Though it can be seen as a duplicate of information, since the main
syslog system used (journald) is capable of filtering messages based on
JID, but having `[Job N]` string in logs in syslog is useful when you
need to debug complex issues and you need to see what happens in the
scheduler and in a specific job at the same time - f.e. at print
servers.

How to reproduce:
0) set error logs to syslog in /etc/cups/cups-files.conf
1) $ cupsctl --debug-logging
2) $ lp -d <queue> <file>
3) $ journalctl -u cups

Actual results:
Cannot distinguish logs from scheduler and from the job

Results after the patch:
Job logs have `[Job N]` at the start of message, where N is a job id.
CHANGES.md
scheduler/log.c