O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

22.4. Monitoring Entries Written to the System Event Logs

.NET allows us to access the system event logs, provided we have been granted sufficient privileges. We can do that through the System.Diagnostics.EventLog class that is a part of the framework. That class is a very powerful tool and can be used to write entries to the event log, and I covered using it in Chapter 16. Most documentation resources about that class focus on its ability to write entries to an event log. We are interested in another feature: the ability to receive notifications about newly written entries. The class exposes an EntryWritten event that will be fired not only when our application logs an event but whenever a different application, running on the same computer, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required