System Administration Guide
Chapter 4, Managing printers and print jobs

About the print request log

About the print request log

Each time a user sends a job to the printer, the print service creates two files that describe the job request and places one each in the /usr/spool/lp/temp and /usr/spool/lp/requests directories. The information about the job is split into two files so that the system can keep sensitive information secure in the /usr/spool/lp/requests directory. The user who submitted the job has access to the request file in /usr/spool/lp/temp; only the lp administrator (or root) has access to the file in /usr/spool/lp/requests.

The request files remain in these directories only while the job is in the queue. When the job finishes printing, the information in the two files is combined and appended to the ``request log'', /usr/spool/lp/logs/requests. 

The structure of the request log is simple, which makes it easy to extract data using common UNIX shell commands. The requests are listed in the order in which they were printed, separated by lines that begin with the request ID. Each line below the separator line is marked with a single letter, the ``request log code'', that identifies the kind of information contained in the line. Each letter is separated from the data by a single space. Table 4-1, ``Request log entries'', describes these codes. Here is a sample entry from the print request log:

   = ps-717, uid 1532, gid 18, size 7872, Tue May 10 14:43:10 1994
   z ps
   C 1
   D ps
   F /usr/spool/lp/temp/717-1
   P 20
   t simple
   U hanna
   s 0x0010

Table 4-1 Request log entries

 Letter   Content of line
 =        The separator line lists the (comma-
          separated) request ID, user ID (uid) and
          group ID (gid) of the user who submitted
          the request, total number of bytes in
          the original (unfiltered) file (size),
          and the date and time the request was
 C        Number of copies printed.
 D        Printer or class destination or the word
 F        Name of the file in the
          /usr/spool/lp/temp directory.  This line
          is repeated for each file printed, and
          files are printed in the order given.
 f        Form name used (if applicable).
 H        Type of special handling used:  resume 
          hold or immediate 
 N        How the print service notified the user
          after printing the file (if applicable):
            M  by an electronic mail message
            W  by a message written to the user's
 O        Any -o options given to lp(C) 
 P        Priority of the print request if
 p        List of pages printed.
 r        Any -r options given to lp(C) indicating
          that the user requested raw processing
          of the file.
 S        Character set or print wheel used 
 s        Outcome of the job, expressed as a
          combination of individual bits in
          hexadecimal form.  The important bits
          used internally by the spooler are:
            0x0004  Slow filtering finished
            0x0010  Printing finished
            0x0040  Request was canceled.
            0x0100  Request failed filtering or
 T        Title on the banner page.
 t        Content type of the file 
 U        Name of the user who submitted the print
 x        Slow filter 
 Y        List of special modes to give to the
          filters used to print the request.
 y        Fast filter 
 z        Printer used for the request.  This
          differs from the destination (the D 
          line) if the request was queued for
          ``any'' printer or a class of printers,
          or if the lp administrator transferred
          the request to another printer.

See also: