15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

476 ❘ ChaPTer 19 instrumentAtiOn<br />

figure 19-5<br />

For custom event logging, you can use classes from the System.Diagnostics namespace.<br />

event-logging architecture<br />

The event log information is stored in several log files. The most important ones are application, security,<br />

<strong>and</strong> system. Looking at the registry configuration of the event log service, you will notice several<br />

entries under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog with<br />

configurations pointing to the specific files. The system log file is used from the system <strong>and</strong> device drivers.<br />

Applications <strong>and</strong> services write to the application log. The security log is a read-only log for applications.<br />

The auditing feature of the operating system uses the security log. Every application can also create a<br />

custom category <strong>and</strong> log file to write event log entries there. For example, this is done by Media Center.<br />

You can read these events by using the administrative tool Event Viewer. The Event Viewer can be started<br />

directly from the Server Explorer of Visual Studio by right-clicking the Event Logs item <strong>and</strong> selecting the<br />

Launch Event Viewer entry from the context menu. The Event Viewer is shown in Figure 19-6.<br />

figure 19-6<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!