Hi team,
I have a requirement to write multiple data intems into eventviewer <eventData> like below
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Elib" />
<EventID Qualifiers="0">0</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-01-03T12:42:30.000000000Z" />
<EventRecordID>33</EventRecordID>
<Channel>Elib</Channel>
<Computer>48vtvs1.ct.chevrontexaco.net</Computer>
<Security />
</System> - <EventData>
<Data>Entry1</Data>
<Data>Entry2</Data>
</EventData>
</Event>
I achieved with the help of eventlog, with the below sample code
Code
EventLog.WriteEvent("Application", new EventInstance(1001, 0, EventLogEntryType.Information),Code
new object[] { "Entry1", "Entry2" });Code
Code
but my requirement is to add attributes to each data node like belowHTML / XML
<EventData>
<Data name="title">Entry1</Data>
<Data name="message">Entry2</Data>
</EventData>
</Event>Code
please help me , how can i add attributes to each node in <evendata>Code
Code
Answers
Know the answer? Post it. Somebody with the same question will find it here.