-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
I have this use case:
- There are multiple variables I want to included in logging
- For most of them, they are strings or numbers, so that I am happy for them to be rendered in the message
- Some of them are huge objects, so that I want it to be not rendered in the message, but still attached as a destructured property of the output
This is the example code with "$" showing the use case:
_logger.LogDebug("Created a Job {jobId} for {customer}. Details: {$job}", jobId, customerName, jobDetails);
For CompactJsonFormatter and RenderedCompactJsonFormatter, the output does not contain destructured details of jobDetails in the property "job". So that it is not very useful to me.
This is the example code with "@" showing the use case:
_logger.LogDebug("Created a Job {jobId} for {customer}. Details: {@jobDetails}", jobId, customerName, jobDetails);
For both CompactJsonFormatter and RenderedCompactJsonFormatter, the output contains destructured details of jobDetails in the property "job".
For RenderedCompactJsonFormatter, the rendered message contains fully destructured details of jobDetails too, so that the same information gets duplicated. Is there a way to tell RenderedCompactJsonFormatter not to render it in the message?
Metadata
Metadata
Assignees
Labels
No labels