Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Show warning about logs in syslog in Web UI#5513

Closed
zdohnal wants to merge 2 commits into
apple:masterfrom
zdohnal:web-ui-syslog-warning
Closed

Show warning about logs in syslog in Web UI#5513
zdohnal wants to merge 2 commits into
apple:masterfrom
zdohnal:web-ui-syslog-warning

Conversation

@zdohnal

@zdohnal zdohnal commented Feb 11, 2019

Copy link
Copy Markdown
Contributor

Hi Mike!
I set all cupsd logs to be in system log (journal), but it breaks viewing logs in CUPS web ui - it ends with 'Not Found', which can be confusing for users.
I tried to focus on the issue and solve it in the pull request - I introduced new file in CUPS_CACHEDIR, which will contain warning message (file is created and the message is written there during reading configuration - if configuration changes in the way there is no logs in syslog, file is deleted):

'The log has been moved to system log. Please consult your logging system for logs.'

CGI binary then gets the file instead of original log file (if CUPS is built with correct features - systemd or vsyslog and the logging is set to syslog).

Viewing logs in web ui shows warning instead of 'Not Found'. Is it acceptable behavior and could it be added to the project?

@michaelrsweet

Copy link
Copy Markdown
Contributor

I'd much rather just hide the log buttons when syslog/etc. are in use.

@michaelrsweet michaelrsweet self-assigned this Feb 12, 2019
@michaelrsweet michaelrsweet added the enhancement New feature or request label Feb 12, 2019
@michaelrsweet michaelrsweet added this to the Future milestone Feb 12, 2019
@zdohnal

zdohnal commented Feb 13, 2019

Copy link
Copy Markdown
Contributor Author

@michaelrsweet You're right, that's better idea, although I found two things:

  1. As I looked into code and if I understood it correctly, it would need to read cups-files.conf in cupsAdminGetServerSettings() function to get current setup of log location. Or move 'AccessLog/ErrorLog/PageLog' directives to cupsd.conf/create a new directive in cupsd.conf for it.

  2. It can be confusing when user will want to have CUPS error_log in syslog, but others in /var/log/cups directory - missing one or two 'View X log' buttons can look bad when the rest will be there.

What is your opinion on these two points? Is it acceptable to read cups-files.conf, set new cgi variable, change admin template a little and set "INPUT TYPE={?variable}" according cgi variable (SUBMIT/HIDDEN)?

@michaelrsweet

Copy link
Copy Markdown
Contributor

Really, given the current (default) use of systemd logging on most Linux distros and the disabling of the web interface by default, my personal preference is just to remove the buttons completely from the admin page.

@zdohnal

zdohnal commented Feb 13, 2019

Copy link
Copy Markdown
Contributor Author

Ok, I'll prepare the removal of log buttons from web ui (even when /var/log/cups location is used).

michaelrsweet added a commit that referenced this pull request Feb 13, 2019
@michaelrsweet

Copy link
Copy Markdown
Contributor

[master 0d94b8b] Remove log buttons from admin page since most Linux distros use systemd logging (Issue #5513)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants