views:

142

answers:

1

I'm using the Enterprise Library Logging application block to allow my application to log various events. This is working fine and the logs can be seen by Event Viewer (eventvwr.exe) going into the Application log.

However, Event Viewer always shows the user field as "N/A". Other applications have the field populated - how do I populate this field?

I have got the current user logged into the exteneded properties of the log entry (using the UnmanagedSecurityContextInformationProvider). This means that I can capture the username and have it appear within Event Viewers 'Description' text box - but I cannot use EventViewers filtering to see one users log entries.

A: 

I've since found this question which suggests this is not possible without breaking into unmanaged Win32 API code - and a posting over on another site that has a MSFT employee stating the same.

Looks like I'll have to just put the username in the main body of the message.

Grhm