-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE CUPS share server - web ui] Implement view/download job specific logs #3
Comments
Hi @mikhailnov , my 2 cents about the RFE - the similar functionality is accessible if you set cupsd to log into syslog (which means systemd-journald in Linux OS), then you can get job-specific logs via:
As for logging into /var/log/cups/error_log, IMHO grepping the file is sufficient. Additionally, it is valuable to see other 'not exactly' job related logs during debugging a print job, so implementing the RFE you've proposed would lead into storing logs into two places - error_log and error_log.jobid (jobid is an unique number in CUPS, it is relevant to a queue where it was sent). Because of above, IMO the RFE is not something I see as important to implement in CUPS. @michaelrsweet thoughts? |
Of course I do not suggest to enable per-tasks logs by default. Thanks for suggesting to use special fields in systemd-journald, I did not know that CUPS sets them. Anyway, all that does not allow to view a per-job log from the web interface. For real printers viewing a per-job log is probably a very rarely needed task. |
@zdohnal |
@mikhailnov |
These would be those 'not exactly' job related logs ;) - not marked by [Job N], but still relevant to see :) .
Thanks for the example! I have been thinking about the RFE in a way the admin in enterprise usually goes via ssh+CLI commands, so journalctl/grep would be okay, but then I realize admins currently prefer a web interface for the machine (f.e. like cockpit) and they don't need to ssh to see the logs.
|
In my above At least for me with CUPS 2.3.3op2 on my homeoffice laptop So with up-to-date CUPS 2.3.x an admin can easily see what had happened FYI: I modified the backend code at its beginning like
I set up a test queue
and ptinted to it with
|
I am not sure than relying on systemd-journald is better then creating files by CUPS because it will require to: Old logs can be deleted by logrotate or systemd-tmpfiles, it will be enough to ship a config for them. But in general your idea about how to implement it looks good to me. |
Also, if use simple text files and open them as plain text, logs can be queried by e.g. curl(1). But I do not know why it may be needed and why SSH cannot be used )) |
@mikhailnov Creating log files per job would greatly increase the processing load of cupsd, not to mention adding more files that would be open for that instead of for client connections (that is already a major limiting factor for the number of simultaneous clients...) Also, providing web access to the log is nice but is yet another security/privacy risk you have to deal with... Anyways, for future versions of the sharing server I can see providing a way for an admin to download/view a log for a print job, which would be extracted from the log file(s) or syslog service as needed. |
@jsmeix thanks for the check, Johannes :)
We have already a #ifdef for systemd support, IMO we can use them in a new cgi script as well.
IMO I can look into journalctl implementation for how they work with sd-journal.h API functions. What I'm currently not sure whether we really need to structure the output into HTML to view/download it in web ui, or we can just put the logs as plain text in a temp file, which will be generated and showed/downloaded when an user clicks on it (I'm not sure whether we will need help of some other language to do it - PHP - or we suffice with current cgi+template solutions). |
A feature request: add per-task logs as text files and add ability to read them via web interface.
Currently the only way to get a per-task log is the following:
grep '\[Job XXX\]' /var/log/cups/error_log
What I would like:
a separate file like /var/log/cups/per-task-logs/printerName-jobID.log
Why?
I am using CUPS to build RPM packages: https://github.com/mikhailnov/pkg-builder-cups
(I do not know how this usecase will be covered after cups-backend becomes depreceated, but currently I did not find anything better than CUPS to be a simple scheduler for building RPM packages).
I want to have per-build logs and have access to them also via a web UI. Currently I see a full build log in
/var/log/cups/error_log
.I understand that this use case does not match CUPS goals, but still openning this issue, may be it will be interesting for something else.
The text was updated successfully, but these errors were encountered: