I implemented an event source class to register events. After repeatedly changing the signature (parameter names and parameter types) of one method that registers events, events are no longer logged correctly. For example, when an event is logged, instead of setting a payload with the name of the current parameter, events are logged using the parameters used for the previous version of the method. For example:
Method n version:
[Event(5, Message = "Action: {0}", Task = Tasks.PAGE, Keywords = Keywords.USER_ACTION, Level = EventLevel.Informational)] public void LogAction(string action, string paramName) { this.WriteEvent(5, action, paramName); }
Version n + 1 of the method:
[Event(5, Message = "Action: {0}", Task = Tasks.PAGE, Keywords = Keywords.USER_ACTION, Level = EventLevel.Informational)] public void LogAction(string action, string newParamName) { this.WriteEvent(5, action, newParamName); }
When this method is called to register events, they are logged by setting the payload with the paramName parameter name instead of newParamName.
And now the question arises: how can I clear the "cache", so the system forgets the old version of the method and the new method can correctly register events?
LE: I checked the logging with PerfView. Funny, he reads magazines correctly. I tested again with SemanticLogging-svc.exe, the logs still display incorrectly. It seems that the problem is not in recording events, but in reading them.
methods signature out-of-process slab
Ovidiu caba
source share