I would like to add custom data into the Windows event log message as formatted text (XML string) . Whatever I add, gets added as strings and are shown with the XML tags. Is there a recommended way to add custom data to the log entry? A typical log entry looks like this:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
...
</System>
<EventData>
<Data>3031358440</Data>
<Data>5</Data>
<Data>WindowsUpdateFailure</Data>
<Data>Not available</Data>
</EventData>
</Event>
I would like to add data like this:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
...
</System>
<EventData>
<Data>
<ThreadID/>
<AssignedPriority/>
</Data>
</EventData>
</Event>