Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 folder and put it under "Applications and Services Logs[SOME FOLDER]\Applications and Services Logs", for examples?

like image 548
RedEagle Avatar asked Jan 20 '11 18:01

RedEagle


1 Answers

The logs stored in the Applications and Services Log section are the logs of custom event publishers as opposed to simple Windows Event Logs.

From this article Technology Summary for Reading and Managing Event Logs:

Applications and Services logs are a different category of event logs than the Windows Logs. The Applications and Services logs store events from a single application or component rather than events that might have system-wide impact. They have a variety of names that are defined by event providers.

Thus, you would need to create a custom Event Publisher. Here are a couple of articles with more information:

  • Developing Event Publishers
  • Developing Using Event Reporting and Tracing
like image 191
Thomas Avatar answered Sep 17 '22 23:09

Thomas