Closed aliostad closed 10 years ago
Doesn't that defeat the whole purpose of semantic logging?
If you only have like 4-5 logging methods why use EventSourceProxy at all? Just implement an EventSource manually?
Mainly because CorrelationId does not flow in async methods when we do that. But using the library, it does, I guess it emits some IL to make sure it happens.
We can use alternative methods of setting the correlation Id but we would love to keep using Trace.CorrelationManager.ActivityId
Unfortunately the underlying .NET EventSource class requires that EventId is constant when it creates the manifest for the event stream.
For the style of logging that you want, I'd recommend something like nLog or Log4Net
OK then, it seems like we have been using the wrong tool. In any case, thanks again for the good work and keep it up.
Hi and thanks for a great library. We are planning to use this in production.
There is one thing that we'd like to do and is the fact that we hardly ever log individualised traces, instead we have a single interface which we use as our logger eg:
This works fine for us - other the fact that we have to hardcode the EventId at the attribute level. I understand that this attribute is provided by the .NET Framework (and is not optional) but what we need is to be able to pass EventId as a variable in the method so that along with the error, we can send the error event Id which is later used by the SCOM monitoring.
So my idea is that if a method has a integer parameter named e.g.
etwEventId
(which is unlikely to accidentally collide with another parameter not intended for this purpose), its value will override the event id defined in the attribute. Even better, this parameter can be defined as nullable with default of null so does not have to be supplied, eg.:I am happy to supply the PR but I guess you might want to implement it the way fits your library best hence I am raising it instead of just sending you PR.
So what are your thoughts?