read from event viewer

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I know there are server tools out there for this but are admins won't run
them on test servers.

what I need is a way to read the event view --> system for a particular
event. I need this to run every 15 minutes and when this event is logged I
need an email to be sent to myself and another developer. Is there a way to
do this?
 
I know there are server tools out there for this but are admins won't run
them on test servers.

what I need is a way to read the event view --> system for a particular
event. I need this to run every 15 minutes and when this event is logged I
need an email to be sent to myself and another developer. Is there a way to
do this?

Hello there,

Have you tried something like...

StringBuilder sb = new StringBuilder();
System.Diagnostics.EventLog log = new
System.Diagnostics.EventLog("System");
foreach(System.Diagnostics.EventLogEntry entry in log.Entries)
{
sb.AppendLine(entry.Message);
}

HTH,
Gary
http://www.garyshort.org
 
I need to only get one event I'm looking for and only if its new and if so,
email the error message to myself and another and have it run every 15
minutes.

I'm able to read the event viewer, but how can I specify the event I want,
and only if its new?
then email it and run it every 15 min?

Also if possible I would like to make this a service or something and not a
web page, so how will email work if I don't know the SMTP server?
 
I need to only get one event I'm looking for and only if its new and if so,
email the error message to myself and another and have it run every 15
minutes.

I'm able to read the event viewer, but how can I specify the event I want,
and only if its new?
then email it and run it every 15 min?

Also if possible I would like to make this a service or something and not a
web page, so how will email work if I don't know the SMTP server?










- Show quoted text -

You can use the properties of eventlog class - probably source and
EventLogEntryType.

See more details: http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog_members(VS.71).aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top