You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To ensure that a message template is correctly logged and properties are transferred as custom properties, you always need to log properties with placeholders in the correct order, e.g. logger.LogWarning("The person {PersonId} could not be found.", personId);
Never use string interpolation because the replacement will be done in your application and the logging backend has no longer access to the message template and individual custom properties: logger.LogWarning($"The person {personId} could not be found.");
Another downside of string interpolation is that objects are always serialized into text in your app even if the log is not actually written because there is a log level filter configured.
into something like logger.LogDebug($"Executing activity #{activityNumber} '{currentActivityName}'...", State.NumCompletedActivities, currentActivity.GetType().Name)
The text was updated successfully, but these errors were encountered:
Two related points:
LogDebug
; the old methods are just legacy compatabiltiy shims (see Legacy LogConsumer provider sink for Microsoft.Extensions.Logging dotnet/orleans#3284).Together, this would turn
Orleans.Sagas/Orleans.Sagas/SagaGrain.cs
Line 224 in 8796433
into something like
logger.LogDebug($"Executing activity #{activityNumber} '{currentActivityName}'...", State.NumCompletedActivities, currentActivity.GetType().Name)
The text was updated successfully, but these errors were encountered: