SqlDatabaseLog InstanceName

Oct 3, 2013 at 7:49 PM
Edited Oct 3, 2013 at 7:50 PM
All the samples show the SqlDatabaseLog.CreateListener instanceName parameter as a simple string.

I need a way to correlate messages from the distinct run of a process. In my mind I have two options. The first would be to add a "SessionId" or equivalent to the payload for all my events. The second much cleaner option would be to use a Guid for the InstanceName. Does that approach raise any red flags? Other ideas?

One downside I see is that if I move to the out-of-proc listener I wouldn't be able to provide a Guid isntanceName via the config file.
Oct 8, 2013 at 5:53 AM
I don't see any major red flags for using a GUID for the InstanceName. You are also correct that if you move to out of process you wouldn't be able to get that instance GUID. Perhaps go with both approaches to ensure the out of process scenario would be supported (albeit not as easily as in process).

Randy Levy
Enterprise Library support engineer
Support How-to