Mar 5, 2013 at 4:03 AM
Edited Mar 5, 2013 at 4:06 AM
Thanks for taking The Semantic Logging Application Block for a test drive!
The reason why you aren't seeing any output is that the statement:
will only log Events that do not have a Keywords value specified (default Keywords value of 0). In the example, Startup() is associated with the Keywords.Perf EventKeyword.
So to enable logging you have two options: specify the desired EventKeywords or remove the Startup Event Keywords.
The former would look like this:
And the latter would look like this:
[Event(2, Message = "Starting up.", Level = EventLevel.Informational)]
internal void Startup()
Actually, there is a related third way -- instead of using the specific Keyword use Keywords.All:
But this would enable all Keywords so, in general, you probably wouldn't want to do that.
In case anyone was wondering, the recommendation for Keywords is that "events that you expect to fire less than 100 times per second do not need special treatment. You should use a default keyword for these events".
Also, I notice that the timeStampFormat for the RollingFlatFileTraceListener is not valid. Colon is an invalid character in a file name -- you could use a "." instead: "yyyy-MM-dd hh.mm.ss"
Enterprise Library support engineer