Event Log Monitor

Posted on 2009-04-13
Last Modified: 2013-12-17
VERY NEW to C# (coding in general)

I want to write an app (console or preferably a service) that will watch the event log for specific words in a Description, and react based upon that error.   For instance:

An event log is written to the Application Log with the word "Fiddler" in the description.  The app will then look back 5 minutes for any other events that may have been recorded (meeting the same criteria) plus look for an event that indicates that a specific service has been recycled....if true, do nothing.  If there are events and the service has not been recycled then recycle the service in question.

The last part just prevents a loop from occurring.  the events will happed when the service is recycled...that is the reasoning behind looking back 5 minutes.
Question by:crokeefe28
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

ppittle earned 500 total points
ID: 24132192

Take a look at this code example:


Author Comment

ID: 24132621
The example is VB.NET....I need C#.  Plus that only writes one new event to the console.
LVL 51

Expert Comment

by:Steve Bink
ID: 24144235
>>> The example is VB.NET....I need C#.  Plus that only writes one new event to the console.

I disagree.  The sample looks like C to me.  It's using C syntax ("string log;" instead of "Dim log as String"), and even has the label C# everywhere on the page.  In fact, the only reference I see to VB.NET at all is in the drop-down box at the top of the page to go to another section.

As far as writing one event to console, that's the example.  Look at it, understand it, then expand it according to your own needs.
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

LVL 96

Expert Comment

by:Bob Learned
ID: 24148691
That web page lets you switch between languages like VB.NET, C#, and C++.

Author Comment

ID: 24153945
I did not see the area on the left to switch between VB and C#.  I will read a little further, but I was hoping to get a better understanding of the requirements to make it happen (being so new to this).
LVL 51

Expert Comment

by:Steve Bink
ID: 24154058
>>> That web page lets you switch between languages like VB.NET, C#, and C++.

LOL!  I get it now...  :)

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Viewers will learn how to use the Hootsuite Dashboard.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question