Redhat Link: How to enable and capture CUPS debugging logs

The procedure below describes how to configure CUPS to produce this information and how to capture it so it can be easily analyzed by the Red Hat support team.

Note: CUPS will generate a prodigious amount of information if left running with debugging enabled. Once the issue has been reproduced and data has been gathered, it may be desirable to undo the changes to /etc/cups/cupsd.conf and restart the cups service once again. Generally, CUPS debugging mode should be enabled only for a short period , while reproducing the issue; however, if CUPS debugging mode must be enabled for an extended period of time, there are some steps (described below) that can be taken to mitigate the amount of storage required to hold CUPS debugging data.

Configuring CUPS

The first task is to configure the CUPS server to emit full debugging information. To do this, follow the instructions below.

  1. As the root user, open /etc/cups/cupsd.conf with a text editor.

    vi /etc/cups/cupsd.conf
  2. Look for the following section.

    MaxLogSize 2000000000
    LogLevel info
  3. Edit the LogLevel and MaxLogSize lines to look like the following:

    MaxLogSize 0    
    LogLevel debug

    The debug LogLevel setting is sufficient for most cases and keeps the size of the error log manageable. The Red Hat technical support representative may ask you set this value to debug2 if more detailed logging is required.

  4. Save the file.

  5. Restart the CUPS service with one of the following commands:

    • RHEL 7 and later:

      systemctl restart cups.service
    • RHEL 6 and earlier:

      service cups restart

Capturing the Error Log File and Reproducing the Issue

To capture the logs for the Red Hat support team while replicating the issue perform the following procedure.

  1. Clear any jobs that are pending in the affected print queue(s):

    cancel -a <queue-name>

    Repeat the command above for each print queue that is having issues. You can also clear jobs from all the print queues by running “cancel -a” (without the queue name).

  2. Make sure that the print queue(s) are enabled:

    cupsenable <queue-name>
  3. Reproduce the printing issue you are experiencing.

  4. For RHEL 7 and earlier, upload /var/log/cups/error_log to the support case.

    For RHEL 8 and later, run the following command:

     journalctl -o export -u cups.service | gzip -c > $(hostname)-$(date +"%Y%m%d-%H%M%S")-cups-journal-export.gz

    and upload the file <hostname>-<date>-cups-journal-export.gz to the support case.

  5. Optionally, generate a new sosreport by running “sosreport --all-logs” as root and attaching it to the support case as well. Additional information on running sosreport can be found in the Knowledgebase Solution entitled What is a sosreport and how to create one in Red Hat Enterprise Linux 4.6 and later?.

Capturing the Error Log File For an Extended Period of Time

In some cases where the issue is intermittent and/or cannot be easily reproduced, it may be necessary to leave CUPS in debug log mode for an extended period of time. To prevent the CUPS error_log from becoming unreasonably large, the following lines can be added to /etc/logrotate.d/cups:

rotate 14

This will rotate the CUPS logs (access_logpage_log, and error_log) on a daily basis, compress the backups, and keep two weeks of backed-up logs.