Questions tagged [event-log]

An event log is a file used to record a timeline of events along with contextual metadata

1270 questions
12
votes
2 answers

Subscription to Windows Event Log?

I'm working on a project that needs to check the Windows Event Log frequently for certain events. I'm wondering - is there a way to create a subscription to the Windows Event Log for certain events? So, when the event happens (e.g. event id =…
urlreader
  • 6,319
  • 7
  • 57
  • 91
12
votes
3 answers

How to open saved event log archive in .NET?

I have used the System.Diagnostics.EventLog to view the logs on the local computer. However, I would like to open a saved event log archive (.evt or .evtx) and view the logs that are contained in the saved file. I just need to view timestamps,…
Brian
  • 1,201
  • 2
  • 14
  • 26
12
votes
3 answers

NT Eventlog single message size

Can anybody tell me what is maximum size of a windows NT log message? I know that it is possible to reset the maximum log size of event log from 32 MB. I am interested about the memory a single message can hold in NT event log. Thanks in advance
Sathish
  • 869
  • 2
  • 13
  • 28
11
votes
1 answer

In Windows, what default event sources are available in the Application Event Log?

Short Version: Are the event sources "Application" and "Application Error" always included in the Application Event Log? Are they available on new installations of Windows XP, Vista and Windows 7? Would it be really bad to use them instead of…
freshr
  • 955
  • 1
  • 9
  • 27
11
votes
2 answers

High Performance Event Log

So I've been trying various ways to get Event Log data in bulk (1000+ records/second). I need something that can filter out old logs, right now I store the last recorded event record ID and retrieve all records where the event ID is greater than…
StrangeWill
  • 2,106
  • 1
  • 23
  • 36
10
votes
2 answers

EventLog - Get available logs

Using the following code, I'm able to display all entries listed under the "Application" log: EventLog appLog = new EventLog(); appLog.Log = "Application"; appLog.MachineName = "."; foreach (EventLogEntry entry in appLog.Entries) { // process } …
jdecuyper
  • 3,934
  • 9
  • 39
  • 51
10
votes
2 answers

Why does EventRecord.FormatDescription() return null?

When using System.Diagnostics.Eventing.Reader.EventLogQuery to read events from the Windows Event Log, the EventRecord.FormatDescription() method sometimes returns null. Why is this? In the Event Viewer there are messages on the events which return…
JohannesH
  • 6,430
  • 5
  • 37
  • 71
10
votes
1 answer

Is there a way to write to the windows event log in C?

I have a requirement to modify a simple windows service written in win32 C (not c++). Is there a library I can use to write event log entries to the windows event log without using eventcreate.exe? Or do I have to modify it to be compiled as a c++…
simon
  • 1,840
  • 2
  • 18
  • 34
10
votes
2 answers

Read Event Log Remotely with .NET

I want to read the Event Log on a remote computer to check for errors during testing. Here's some relevant code: public bool CheckEventLogs(DateTime start) { EventLog myEventLog = new EventLog("CustomLog", "ServerName"); bool errorFound =…
Brian
  • 1,201
  • 2
  • 14
  • 26
10
votes
1 answer

Log to event viewer on Windows with C++

I want to use log on my C++ application. However, I'd like to use Windows (10) event viewer, instead of text files. I found out some weird calls, that I don't even know what the parameters mean - ReportEvent, OpenEventLog and some other Event…
Leonardo Alves Machado
  • 2,747
  • 10
  • 38
  • 53
10
votes
2 answers

Receiving "...has already been registered..." from EventLog.CreateEventSource even though I'm checking !EventLog.SourceExists

My following code fails with "...has already been registered as a source on the local computer" even though I'm doing checks first: lock ( eventLock ) { string eventLog = Constants.EventLogPL; string eventSrc = Constants.EventSrcPL; if…
John Warlow
  • 2,922
  • 1
  • 34
  • 49
10
votes
2 answers

.NET remoting service seemingly crashes, and stops responding to clients

I have a .NET Remoting service which works fine most of the time. If an exception or error happens, it logs the error to a file but still continues to run. However, about once every two weeks the service stops responding to clients, which causes the…
codewario
  • 19,553
  • 20
  • 90
  • 159
10
votes
4 answers

Query windows event log for the past two weeks

I am trying to export a windows event log but limit the exported events not according to number but according to time the event was logged. I am trying to do that on windows 7 and newer. So far my efforts are focused on using wevtutil. I am using…
Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
10
votes
1 answer

EventLogQuery: How to form query string?

I have the following code: string query = "???"; EventLogQuery elq = new EventLogQuery("Application", PathType.LogName, query); elq.Session = new EventLogSession("x.x.x.x"); EventLogReader elr = new EventLogReader(elq); I'm trying to figure out…
Brandon Moore
  • 8,590
  • 15
  • 65
  • 120
9
votes
8 answers

How to troubleshoot .NET 2.0 Error Reporting messages in the event log?

I work on an open source product called EVEMon written in C# targeting the .NET 2.0 platform, I have one user who is suffering from a strange .NET crash that we have been unable to resolve. Event Type: Error Event Source: .NET Runtime 2.0 Error…
Richard Slater
  • 6,313
  • 4
  • 53
  • 81