printlog — Printer Use Logging
PPR can keep a running log of jobs printed. To enable this logging, create an empty file /var/log/ppr/printlog. One line will be appended to this file for each job which is successfully printed.
A typical print log entry looks like this:
19961115131401,rotate-1375.0(mouse),chipmunk,"David Chappell",chappell, "",7,1,2,166,30.12,0.00,-1,80123,2
(In reality this would be a single long line. We have split the example line so that it will fit on the page.)
The meanings of the fields in the above log line is as follows:
The 1st field is the date and time at which the job was submitted. In this case the date is November 15th, 1996. The time is 1:14pm.
The 2nd field is the job id. This job was submitted to the group called rotate.
The 3rd field is the printer it was printed on. This job was printed on the printer named chipmunk which is presumably a member of the group rotate.
The 4th field is the name of the person who printed it. This is the name as it appeared in the queue listing and on banner pages. This is a quoted field.
The 5th field is the name of the username of the user who submitted the job
The 6th field is unused. It was the "proxy for" field prior to PPR 2.00.
The 7th field is the number of logical pages in the job. This ought to be the number of %%Page: comments in the PostScript file. If the number of pages is unknown this field will contain the value -1.
The 8th field is the number of sheets of paper used. This job was printed 4-Up in duplex mode so only one sheet was used. If 5 copies had been printed, this number would have been 5.
The 9th field is the number of actual pages (sides) printed. Since this job prints four reduced-size pages to an actual page, this field is 2. If 5 copies had been printed, this field would have contained a 10.
The 10th field is the number of seconds which elapsed between the time the job was queued and the time printing was completed. (To be more precise, the interval between when the program ppr was invoked and the time pprdrv wrote the log entry.) This job was finished two minutes and 46 seconds after it entered the queue.
The 11th field is the number of seconds between the time pprdrv started up and the time if wrote the log entry. It is expressed in seconds and hundredths of a second.
The 12th field shows the amount of money charged. This is a fixed point number with two digits after the decimal point. No monetary unit is indicated.
The 13th field shows the number of sides the printer says it printed. This number will likely be obtained though HP PJL. Note that at this time, the value in this field is not used to compute the charge in the 12th field.
The 14th field reports the number of pages the printer claimed to have printed over its lifetime. This field is -1 if the number was not retrieved. An attempt to retrieve it will only be made if the printer's configuration file contains a PageCountQuery: line which enables this feature and the feedback setting is true. When this feature is enabled, the page count is fetched just after printing the banner page and just before printing the job itself. If printing is successful, the resulting value will ultimately be logged in the 14th field.
The 15th field is meaningful only if the value in the 14th field is not -1. Once the job has been printed, but before a trailer page is printed, the page count query is repeated. If the query is successful, then the difference between the before and after page counts is logged in this field. If the query is not performed or is not successful, then a -1 is loggged in this field. See the discussion of the PageCountQuery: line in the PPR Hackers Guide for a discussion of why the value logged in this field may not accurately reflect the number of pages printed.
The 16th field is the size of the PostScript job in bytes. If the input file was PostScript, then this is the size of the input file. If the job had to be converted to PostScript, then this is the size of the PostScript output of the filter.
The 17th field is the number of bytes that were sent to the printer in order to print this job. This number may be significantly greater than the number in field 16. For example, it may have been necessary to print multiple copies by sending the job several times or PPR may have inserted fonts into the job.
The 18th field is the title of the job. If the job had no title, then the name of the input file is used. If there was no input file (such as if the job was read from stdin), then this field will be blank. This is a quoted field.
If left uncontrolled, the printlog file will grow indefinitely, so steps should be taken to truncate it regularly.
PPR was written at Trinity College during 1993--2005. It was first released to the public on 26 April 1995.
David Chappell, Trinity College Computing Center, Hartford, Connecticut.