Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Provide a way to provide an output format for CorrelationId #93

Open
ovation22 opened this issue Dec 15, 2022 · 0 comments
Open

Provide a way to provide an output format for CorrelationId #93

ovation22 opened this issue Dec 15, 2022 · 0 comments

Comments

@ovation22
Copy link

Similar to how it's possible to format Level, would it be possible/valuable to format CorrelationId? Ideally first-N characters and/or last-N characters?

Example from LevelOutputFormat:

https://github.com/serilog/serilog/blob/7f1e791c411457eb392a9b4833a5545a90a67ba7/src/Serilog/Formatting/Display/LevelOutputFormat.cs#L20

Proposal:

"w1" (one lowercase char)
"e3" (end three chars)

"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3} {CorrelationId:e12}] {Message:lj}{NewLine}{Exception}"

With CorrelationId a103d6e7-e2d0-47b2-8442-120fdc2bb775, would produce:

[18:28:01 DBG 120fdc2bb775] Connection id "0HMMUP8CI08F3" completed keep alive response.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant