Questions tagged [event-log]

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

1270 questions
6
votes
4 answers

How to store event log in Folder

On an ASP NET project (C#) I'm using the System.Diagnostics namespace to log errors, warning and information. Using Windows 7 I see that the log I've set for the project is under "Applications and Services Logs". How can I set in code to create a…
RedEagle
  • 4,418
  • 9
  • 41
  • 64
6
votes
0 answers

EventLog appender C# does not write in event log viewer

I need to make my C# application to write log in Windows Event viewer. I Used ,
Jeeva N
  • 431
  • 1
  • 5
  • 17
6
votes
8 answers

C#: GUI to display realtime messages from Windows Service

I've written a C# windows service which can write messages to a custom EventLog or to any number of files. These messages are all marked with some priority (so, for example, only ERRORs and WARNINGs get stored in the EventLog, but if desired a lot…
chezy525
  • 4,025
  • 6
  • 28
  • 41
6
votes
6 answers

How to view Windows Event Log remotely with limited privileges

To debug some code, I would like to view the Windows event log of a remote machine (target is Windows2003). With mmc.exe I can add the event log for a remote machine, but only if I have sufficient permissions. For this remote machine, they do not…
Frank Schwieterman
  • 24,142
  • 15
  • 92
  • 130
6
votes
2 answers

Use Event Log (Write in Event Viewer) in Azure

My website, written in ASP.NET and i used EventLog to write logs into the event viewer. It is already been running in the production (OS: Windows Server 2012 R2) and no problems encountered upon logging some errors. I am now planning to migrate the…
heyou
  • 315
  • 1
  • 7
  • 14
6
votes
3 answers

Who knows how to use the mc.exe (Message Compiler)?

I am trying to use the mc.exe to make message files for my event log writing program. But even the sample message file provided by the Microsoft won't compile. Who knows how to write a message file that could be compiled by mc.exe? EDIT: The error…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
6
votes
2 answers

Event Logging in C# on Windows 7/ 2008 Server

i am trying to make an event logger for my cmd line application. However I get this error when it tries to create the log for the first time. The source was not found, but some or all event logs could not be searched. Inaccessible logs:…
chobo2
  • 83,322
  • 195
  • 530
  • 832
6
votes
2 answers

How to find out EventProperty name?

My C# application subscribes to Windows Event Log messages: var subscriptionQuery = new EventLogQuery(Settings.Default.LogPath, PathType.LogName, Settings.Default.LogQuery); _watcher = new…
m0n5ter
  • 143
  • 1
  • 8
6
votes
4 answers

(Windows) Exception Handling: to Event Log or to Database?

I've worked in shops where I've implemented Exception Handling into the event log, and into a table in the database. Each have their merits, of which I can highlight a few based on my experience: Event Log Industry standard location for exceptions…
pearcewg
  • 9,545
  • 21
  • 79
  • 125
6
votes
1 answer

Filtering Windows logs using lambda expressions on non-IEnumerable types

I'm trying to get and filter Windows logs based on some criteria, one of which is filter by Message. The Message property is in EventLog.GetEventLogs().Entries.Message. The problem is Entries is an EventLogEntryCollection and I can't run a lambda…
Arian Motamedi
  • 7,123
  • 10
  • 42
  • 82
6
votes
5 answers

Find out username(who) modified file in C#

I am using a FileSystemWatcher to monitor a folder. But when there is some event happening in the directory, I don't know how to search who made a impact on that file. I tried to use EventLog. It just couldn't work. Is there another way to do it?
Kevin Qu
  • 107
  • 1
  • 1
  • 9
6
votes
1 answer

Event log message size 31885? Windows 2008

We recently upgraded our production boxes to Windows 2008 from Windows 2003 servers. Everything works fine except the event logging. We log at max 32000 bytes of data for each message. On 2008 servers, event logging fails if number of characters is…
testuser
  • 668
  • 10
  • 23
6
votes
2 answers

Eventlog listener - Applications and Services

Is there a way to watch events of "applications and services" when they are generated (in C#)? I've figured out that I can not use WMI for it. Any other ideas?
user1011394
  • 1,656
  • 6
  • 28
  • 41
6
votes
3 answers

Processing events from Event Log and react on a certain pattern (Rx?)

I need to process events coming from the EventLog. This is easy using the EventLogWatcher attaching to the EventRecordWritten event. However the query I am interested in (eventid == 299 || eventid == 500) provides more events than what I need. Here…
woloski
  • 2,863
  • 16
  • 14
6
votes
2 answers

When to log into the windows event log?

So far all my applications have been logging to files only. It works fine for me and I never had any problem with it. A friend of mine suggested I could also use the Windows Event log but I am not sure about that. I always had the idea the Event Log…
TalkingCode
  • 13,407
  • 27
  • 102
  • 147