.NET Tip Idaho

Simplify finding the entry you need from an event log. Read on and learn more.

Local Companies

Intelligent Employment Solutions
(208) 377-0945
7964 W Fairview Ave
Boise, ID
Capital City Computer Services
(208) 376-7471
9194 W Calico St
Boise, ID
S1 IT Solutions
(208) 381-0679
420 W Main St
Boise, ID
Employment Solutions Inc
(208) 323-0883
260 S Cole Rd
Boise, ID
Cougar Mountain Software Inc
(208) 375-4455
7180 Potomac Dr
Boise, ID
Integrinet Solutions
(208) 376-0500
10020 W Fairview Ave
Boise, ID
Blackfin Technology
(208) 338-1581
1702 W Fairview Ave
Boise, ID
Microsoft Dynamics Gp Nav Solutions Center
(208) 344-5098
7699 W Riverside Dr
Boise, ID
Aagave Solutions LLC
(208) 331-4593
202 N 9th St
Boise, ID
Analyze Soft
(208) 343-2075
3514 S Crosspoint Ave
Boise, ID



I frequently receive calls asking why an application is not behaving as expected. Many times, a quick look at the database can provide the answer. Sometimes, however, things are a little more involved. Our internal applications make extensive use of event logs. The event logs will contain error messages, warnings, and in the case of some occasionally connected systems a log of all the data received. Trying to manually forge through the event logs can be a daunting task. The answer, of course, is to let a computer do most of the searching for you. Here is a class with a couple static methods that you can use to quickly limit the number of event log entries that you have to manually search through:

public enum EventLogFilterType
{
TimeGenerated,
UserName,
MachineName,
Category,
Source,
EntryType,
Message,
EventID
}

public sealed class SearchEventLog
{
// Prevent this class from being instantiated.
private SearchEventLog() {}
public static EventLogEntry[]
FilterEventLog(EventLogFilterType FilterType,
IEnumerable Entries, object Criteria1,
object Criteria2)
{
ArrayList FilteredEntries = new ArrayList();
foreach (EventLogEntry Entry in Entries)
{
switch (FilterType)
{
case EventLogFilterType.TimeGenerated:...

Read the Rest of this Article at Developer.com

Featured Local Company

Integrinet Solutions

(208) 376-0500
10020 W Fairview Ave
Boise, ID


Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML