System Administration Guide, Volume 2

History Logs

The LP print service records a history of printing services in two log files: lpsched and requests. These log files are located in the /var/lp/logs directory. You can use the information in these logs to diagnose and troubleshoot printing problems. This is an example of the contents of the /var/lp/logs directory:


# cd /var/lp/logs
# ls
lpsched.1    requests    requests.2
lpsched      lpsched.2   requests.1
# 

The files with the .1 and .2 suffixes are copies of the previous day's logs. Each day, the lp cron job cleans out the lpsched and requests log files and keeps copies for two days. See "Creating and Editing crontab Files" for suggestions on modifying the cron job for cleaning out the requests log.

The two most important log files for troubleshooting is the lpsched log, which contains information about local printing requests

The requests log contains information about print requests that are completed and no longer in the print queue. Once a request is finished printing, the information in the /var/spool/lp log files is combined and appended to the /var/lp/logs/requests log.

The requests log has a simple structure, so that you can extract data using common UNIX shell commands. Requests are listed in the order they are printed, and are separated by lines showing their request IDs. Each line below the separator line is marked with a single letter that identifies the kind of information contained in that line. Each letter is separated from the data by a single space.

The following example shows the contents of a requests log:


# pwd
/var/lp/logs
# tail requests.2
= slw2-20, uid 200, gid 200, size 5123, Tue Jun 17 10:16:10 MDT
1998
z slw2
C 1
D slw2
F /etc/motd
P 20
t simple
U irving
s 0x0100
#

The table below shows the letter codes and the content of their corresponding lines in the LP requests log.

Table 8-4 Letter Codes in the LP requests Log

Letter 

Content of Line 

=

The separator line. It contains the following items: request ID, user ID (UID), and group IDs (GIDs) of the user, the total number of bytes in the original (unfiltered) file size, and the time when the request was queued. 

C

The number of copies printed. 

D

The printer or class destination or the word any.

F

The name of the file printed. The line is repeated for each file printed; files were printed in the order shown. 

f

The name of the form used. 

H

One of three types of special handling: resume, hold, and immediate.  

N

The type of alert used when the print request was successfully completed. The type is the letter M if the user was notified by email or W if the user was notified by a message to the terminal.

O

The printer-dependent -o options (for example, nobanner).

P

The priority of the print request. 

p

The list of pages printed. 

r

A single-letter line that is included if the user asked for "raw" processing of the files (the lp -r command).

S

The character set, print wheel, or cartridge used. 

s

The outcome of the request, shown as a combination of individual bits expressed in hexadecimal form. Several bits are used internally by the print service. The bits and what they mean are describe in the table below. 

T

The title placed on the banner page. 

t

The type of content found in the files. 

U

The name of the user who submitted the print request. 

x

The slow filter used for the print request. 

Y

The list of special modes for the print filters used to print the request. 

z

The printer used for the request. This printer differs from the destination (the D line) if the request was queued for any printer or a class of printers, or if the request was moved to another destination.

The table below shows the outcome codes in the LP requests log and their descriptions.

Table 8-5 Outcome Codes in the LP requests Log

Outcome Code 

Description 

0x0001

The request was held pending resume. 

0x0002

Slow filtering is running. 

0x0004

Slow filtering finished successfully. 

0x0008

The request is on the printer. 

0x0010

Printing finished successfully. 

0x0020

The request was held pending user change. 

0x0040

The request was canceled. 

0x0080

The request will print next. 

0x0100

The request failed filtering or printing. 

0x0200

The request is in transit to a remote printer. (obsolete) 

0x0400

The user will be notified. 

0x0800

A notification is running. 

0x1000

A remote system has accepted the request. (obsolete) 

0x2000

The administrator placed a hold on the request. 

0x4000

The printer had to change filters. 

0x8000

The request is temporarily stopped.