Printer Monitoring Service configuration

The settings used by the printer monitoring service (e.g. which printers to monitor and where the location of the sql server to record the events to is etc.) are stored in the PrinterMonitoringService.exe.config file

The "application" level settings held in the <appSettings> section are:-
  • MonitorJobEventInformationLevel - How much information to record for print jobs
  • MonitorPrinterChangeEvent - True to monitor printer status change events
  • MonitorJobAddedEvent - True to be alerted when jobs are added to the monitored print queues
  • MonitorDeletedEvent - True to be notified when jobs are removed from the print queue (either as it is printed or deleted by the user)
  • MonitorJobSetEvent - True to be notified when the properties of a print job are changed by user or application interaction with it
  • MonitorJobWrittenEvent - True to be notified when print job data is information
  • ReadSettingsFromDB - If true then the printer monitor service settings are read from the Data model
  • ConnectionString - The ODBC connection string that the service uses to find the data model

There are additional sections that control aspects of the service for maximum flexibility:


PrinterEventListeners are classes that are called to when the printer change events occur


PrintJobEventListeners are classes that are called when print job events occured

<!-- Key = the unique name by which the listener is known,
ClassType = the full type name of the class implementing IPrinterEventListenerBase ,
CommandLine = startup parameters for that class
<printJobEventListener key="printJobEventDBListener"
commandLine="Persist Security Info=False;Integrated Security=SSPI;database=PrintMonitor;server=(local);Connect Timeout=30" />

If the database is hosted on a different machine than the printer monitor service then you need to change the commandLine accordingly.


MonitoredPrinters list the printers to be monitored by this service. Note that if this list is empty then all the printers that the service can see will be monitored.

<monitoredPrinter DeviceName="Microsoft Office Document Image Writer"/>

Note: if the <add key="ReadSettingsFromDB" value="True" /> is set to true the monitored printers section is ignored.

Trace switches

There are two defined trace switches - Application and _PrinterMonitorComponent that you can set to log a trace file of the operation of the application if you need to debug or diagnose problems

<!-- Printer Monitor Component tracing : values can be
<add name="PrinterMonitorComponent" value="2" />
<add name="Application" value="4" />
<trace autoflush="false" indentsize="4">
<add name="LogFileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\Temp\PrinterMonitorService.log" />

Last edited Jan 28, 2007 at 5:33 PM by Merrion, version 5


No comments yet.