Hi @Valeriy Sudakov
_logger.LogInformation("CustomProperties", properties);
The issue relates the use of LoggerExtensions.LogInformation Method, to formats and writes an informational log message. You can change your code as below:
Dictionary<string, string> properties = new Dictionary<string, string>()
{
{ "Prop1", "abc" },
{ "Prop2", "def" },
};
_logger.LogInformation("CustomProperties {properties}", properties);
Then the result as below:
Or you can serialize the dictionary to a Json string, then log the result:
var logmessage = System.Text.Json.JsonSerializer.Serialize(properties);
_logger.LogInformation($"CustomProperties: {logmessage}");
The output as below:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion