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

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

printJobEventListeners

PrintJobEventListeners are classes that are called when print job events occured

<printJobEventListeners>
<!-- 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"
classType="PrinterMonitorService.PrintJobMonitorDatabaseListener"
commandLine="Persist Security Info=False;Integrated Security=SSPI;database=PrintMonitor;server=(local);Connect Timeout=30" />
</printJobEventListeners>

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

monitoredPrinters

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.

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

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

<system.diagnostics>
<switches>
<!-- Printer Monitor Component tracing : values can be
Off=0
Error=1
Warning=2
Info=3
Verbose=4
-->
<add name="PrinterMonitorComponent" value="2" />
<add name="Application" value="4" />
</switches>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="LogFileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\Temp\PrinterMonitorService.log" />
</listeners>
</trace>
</system.diagnostics>

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

Comments

No comments yet.