Server Logging Configuration
Prev
Next

Server Logging Configuration

The server logging configuration is done on this screen. It includes:

This is an important screen for you. Should you ever encounter problems: here is the place to set the Log level to “debug”, restart the CUPS daemon and then look at the Error log file defined here for entries that might give you an insight to the trouble.


The dialog to configure the CUPS server: Server
logging
Access log file

This is where accesses to the server are logged. If this does not start with a leading /, then it is assumed to be relative to the server root.

You can also use the special name syslog to send the output to the syslog file or daemon.

Enter a path, for example /var/log/cups/acces_log.

The format of this file is stored in the so-called “Common Log Format”. This way you can use programs such as Webalyzer or any other Web access reporting tool to generate reports on the CUPS server activities.

To include the server name in the file name use a %s in the name. Example: /var/log/cups/access_log-%s.

kurt@transmeta:~ >tail /var/log/cups/access_log

127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST /printers/ HTTP/1.1" 200 109
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST /admin/ HTTP/1.1" 401 0
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST / HTTP/1.1" 200 210
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "GET /ppd/DANKA_P450.ppd HTTP/1.1" 200 51021
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST /jobs/ HTTP/1.1" 200 246
10.160.16.45 - - [04/Aug/2001:20:11:39 +0100] "GET /printers/DANKA_P450 HTTP/1.0" 200 0
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST / HTTP/1.1" 200 80
127.0.0.1    - - [04/Aug/2001:20:11:39 +0100] "POST / HTTP/1.1" 200 139
10.160.16.45 - - [04/Aug/2001:20:11:40 +0100] "GET /cups.css HTTP/1.0" 200 198
127.0.0.1    - - [04/Aug/2001:20:11:40 +0100] "POST / HTTP/1.1" 200 139
10.160.16.45 - - [04/Aug/2001:20:11:39 +0100] "GET /printers/DANKA_P450 HTTP/1.0" 200 7319
10.160.16.45 - - [04/Aug/2001:20:11:40 +0100] "GET /images/title-logo.gif HTTP/1.0" 200 5729

You see a separate line for each single access, showing the IP address of the accessing client, date and time of access, method of access (POST or GET), the requested ressource, the HTTP version used by the client, status code and the number of transferred bytes. Status code 200 means successful-OK the 401 in the above example was an unauthorized access which was denied. For a detailed explanation of the log format go to the CUPS Software Administrator Manual.

Error log file

If this does not start with a leading /, then it is assumed to be relative to the server root. The default setting is /var/log/cups/error_log.

You can also use the special name syslog to send the output to the syslog file or daemon.

Enter the path, for example /var/log/cups/error_log.

The error log excerpt below shows you the part logged for printing the test page with the default setting of Log level to “info”. For an explanation of the Log Level setting see further below.

kurt@transmeta:~ > tail  /var/log/cups/error_log

I [04/Aug/2001:23:15:10 +0100] Job 213 queued on 'DANKA_P450' by 'root'
I [04/Aug/2001:23:15:10 +0100] Started filter /usr/lib/cups/filter/pstops (PID 18891) for job 213.
I [04/Aug/2001:23:15:10 +0100] Started backend /usr/lib/cups/backend/lpd (PID 18892) for job 213.
Page log file

If this does not start with a leading / then it is assumed to be relative to the server root. The default is /var/log/cups/page_log

You can also use the special name syslog to send the output to the syslog file or daemon.

Enter the path, for example /var/log/cups/page_log.

The page log file has a line for every single page of every job printed.

Here is what some entries look like:

kurt@transmeta:~ > tail  /var/log/cups/page_log

GIMP_print_stp_HP kdetest 201 [03/Aug/2001:03:18:03 +0100] 4 1
GIMP_print_stp_HP kdetest 201 [03/Aug/2001:03:18:03 +0100] 5 1
GIMP_print_stp_HP kdetest 202 [03/Aug/2001:11:46:49 +0100] 1 1
GIMP_print_stp_HP kdetest 203 [03/Aug/2001:11:46:54 +0100] 1 1
DANKA_infotec_P450 kurt 204 [04/Aug/2001:03:29:00 +0100] 1 33
DANKA_infotec_P450 kurt 204 [04/Aug/2001:03:29:00 +0100] 2 33
DANKA_infotec_P450 kurt 204 [04/Aug/2001:03:29:00 +0100] 3 33
DANKA_infotec_P450 kurt 204 [04/Aug/2001:03:29:00 +0100] 4 33
DANKA_infotec_P450 root 205 [04/Aug/2001:19:12:34 +0100] 1 14
DANKA_infotec_P450 root 206 [04/Aug/2001:19:15:20 +0100] 1 1

In this excerpt of the file you find information on the name of the printers (GIMP_print_stp_HP and DANKA_infotec_P450) used through this server, the user names (kdetest, kurt and root), the job-IDs (“201” to “205”), time of printing, page number inside the job and the number of copies for the pages. For example, job-ID 204 had 4 pages and 33 copies printed, job-ID 205 had 14 copies of just 1 page) .

Note

CUPS is dependent (for its calculation of the number of pages in a job) on passing the PostScript® through the “pstops” filter. See the Kivio Flowchart on the CUPS filter architecture for an idea about were this filter fits into the whole printing process). More, pstops depends for the counting on a DSC conforming (DSC is Document Structuring Conventions, a standard defined by Adobe) to be sent by the client. In most cases this is working.

However, this page accounting does not work for any “raw” printer queues (as those, by definition, don't use any filtering on the CUPS host and are by-passing pstops.) Every job going through a “raw” queue is counted as a 1-page-job (with possibly multiple copies). This is especially true for all Jobs send from Microsoft® Windows® clients via Samba to the CUPS server, as those jobs are already arriving in the correct format for the printer, because the clients use the original printer driver.

Note

I am still looking for someone who will write a nice CUPS page log analysing tool. It should generate a report with a graphical output similar to the Webalizer's access log reports. This way you could have nice statistics to be used for accounting about usage of printers, load dependent on daytime or weekday, users etc. Anyone?

Log level

This setting controls the number of messages logged to the error log file. It can be one of the following:

debug2

Log everything.

debug

Log almost everything.

info

Log all requests and state changes.

warn

Log errors and warnings.

error

Log only errors.

none

Log nothing.

If you need to troubleshoot (or if you want to study the inner workings of CUPS), set the log level to debug or debug2. Then the error_log will have a lot more entries (not just errors, but also informational entries).

You can use this to watch “live” what CUPS is doing when you send a print job. In a Konsole type:

kurt@transmeta:~ >tail -f -n100 /var/log/cups/error_log

This will give you the last 100 lines (-n 100) of the file onto the screen and a “realtime” update (-f)of what is happening. The following listing shows the printing of a test page (some pieces have been cut off for space reasons... Try it yourself if you need more info):

 
I [04/Aug/2001:23:15:12 +0100] Job 214 queued on 'DANKA_P450' by 'root'
D [04/Aug/2001:23:15:12 +0100] StartJob(214, 08426fe0) 
D [04/Aug/2001:23:15:12 +0100] StartJob() id = 214, file = 0/1 
D [04/Aug/2001:23:15:12 +0100] job-sheets=none,none 
D [04/Aug/2001:23:15:12 +0100] banner_page = 0 
D [04/Aug/2001:23:15:12 +0100] StartJob: argv = "DANKA_P450","214","root","TDE Print Test",
[....]  
D [04/Aug/2001:23:15:12 +0100] StartJob: envp = "PATH=/usr/lib/cups/filter:/bin:/usr/bin", [....]  
D [04/Aug/2001:23:15:12 +0100] StartJob: statusfds = 5, 6 
D [04/Aug/2001:23:15:12 +0100] StartJob: filterfds[1] = 7, -1 
D [04/Aug/2001:23:15:12 +0100] StartJob: filter = "/usr/lib/cups/filter/pstops" 
D [04/Aug/2001:23:15:12 +0100] StartJob: filterfds[0] = 8, 9 
D [04/Aug/2001:23:15:12 +0100] start_process("/usr/lib/cups/filter/pstops", [....]  
I [04/Aug/2001:23:15:12 +0100] Started filter /usr/lib/cups/filter/pstops (PID 18991) for job 214.  
D [04/Aug/2001:23:15:12 +0100] StartJob: backend = "/usr/lib/cups/backend/lpd" 
D [04/Aug/2001:23:15:12 +0100] StartJob: filterfds[1] = -1, 7 
D [04/Aug/2001:23:15:12 +0100] start_process("/usr/lib/cups/backend/lpd", [....]  
I [04/Aug/2001:23:15:12 +0100] Started backend /usr/lib/cups/backend/lpd (PID 18992) for job 214.
D [04/Aug/2001:23:15:12 +0100] Page = 595x842; 15,16 to 580,833 [....]  

The lines tagged “D” at the beginning are debug level entries, the ones tagged “I” are there in “info” level.

Max log file size

Controls the maximum size of each log file before they are rotated. Defaults to 1048576 (1 Mb). Set this to 0 to disable log rotation.

Enter an size in bytes, for example 1048576

Prev
Next
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team