Skip to content

Maintenance: Log Formatter updates #868

@hjgraca

Description

@hjgraca

Summary

Refactor Logging to improve message template formatting and parameter handling. It also removes extra keys extensions code and ensures consistent usage of logging methods.

currently this is how we format with extra keys

Logger.LogInformation<User>(user, "{Name} is {Age} years old", 
          new object[]{user.Name, user.Age});

we want to replace this with

Logger.LogInformation("{@user}", user);

Why is this needed?

The following snippet should work and output correctly and not expect to be an extra key

logger.LogInformation("This is a test with {param}", "Hello");

output

{
  "message" : "This is a test with Hello".
  "param": "Hello"
}

Which area does this relate to?

No response

Solution

No response

Acknowledgment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions