SQLDatabaseLog

Topics: Using
Jul 24, 2014 at 8:16 PM
Edited Jul 24, 2014 at 8:23 PM
I followed the example for aExpense and I have been able to get that to log to my local SQL database. Then as I try a simple windows program on my own, I cannot get it to log to the same database. I run SQL Profiler and I see Audit Login when I start the application, but then nothing, and I see an Audit Logout when I close the application. Where as I can see the calls with the aExpense web app. I am trying to create a proof of concept here but I haven't been able to get this to log to local DB.

I set up the listener with
             listener = SqlDatabaseLog.CreateListener("SemanticApplicationLoggingTest", "Data Source=XXXXXXXXXX;Initial Catalog=Logging;Integrated Security=True");
             listener.EnableEvents(MyEventSource.Log, EventLevel.Verbose);
Jul 24, 2014 at 8:24 PM
Edited Jul 24, 2014 at 8:32 PM
Assuming MyEventSource is well formed (you can test that with EventSourceAnalyzer), then what could explain this is if the events that you expect to see have a Keyword associated with them. By default, that call to EnableEvents only log events with no keywords. If you want to log all events, use the following overload:
listener.EnableEvents(MyEventSource.Log, EventLevel.Verbose, Keywords.All);