I implemented an event source class for logging events. After repeatedly changing the signature (parameters names and parameters types) of one method that logs events, the events are no longer correctly logged. For instance when an event is logged, instead of setting the Payload with the current parameters name, the events are logged using the parameters used for the previous version of the method. Eg:
Version n of the method:
[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 for logging events, they are logged setting the Payload value with the parameter name paramName instead of newParamName.
And now, the question: how do I clear the "cache", so the system forgets the old version of the method and the new method can log the events correctly?
LE: I tested logging with PerfView. Funny thing, it reads the logs correctly. I tested again with SemanticLogging-svc.exe, the logs are still displayed incorrect. It looks like the problem is not on logging the events, but in reading them.