]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler/log.c: Use `[Job N]` even for syslog 154/head
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 19 Mar 2021 08:25:41 +0000 (09:25 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 19 Mar 2021 08:25:41 +0000 (09:25 +0100)
commitbd78697d2e164461c4bd7db791c3563373f87c26
tree4a7f408a3610451368dea0a02de4138ea4051220
parent76addef7de1fdc8bad7222910085916a4e4c7a9f
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