0

We are looking into writing a C# program which will export Event Viewer logs into csv file.

DateTime              |Level    | Source | EventID | Detail
06/16/2016 10:11:01    Error       ABC      100      Detail of event error

Can you please guide/hint if you knows anything which suits for this? Thank You!

Oxygen
  • 831
  • 4
  • 17
  • 42

1 Answers1

1

This application exists of two parts. 1. Reading the eventlog 2. Writing to a csv file

Reading the eventlog is built in to .NET. Examples can be found here. The application might need administrator rights to do this.

For writing to a csv file you can use the .net file and stringbuilder classes. In a csv file each line is a row and columns are split by a comma. This is already discussed in an other question: Writing data into CSV file

Community
  • 1
  • 1
Maiko Kingma
  • 929
  • 3
  • 14
  • 29