I would like to pass the trace id to my logs on every message. #232
Replies: 1 comment 3 replies
-
Hi @rolfwessels! For your question I would suggest checking the source code of the MessageTemplateTextFormatter (I highlighted the line). Also I believe you could got a lot from the structured logging if you will use LokiJsonTextFormatter and Grafana Loki json parser. In that case you will get a lot of useful properties, that could be used for the work with logs. If you wondering how it works, I would suggest checking the Serilog.Sinks.Grafana.Loki.SampleWebApp from that repository (you could spin up all required infra, using The structured logging could give you more benefits, comparing to the simple |
Beta Was this translation helpful? Give feedback.
-
First, thank you to the creators for this package. It's been handy.
Unfortunately, I would like to add TraceId to the labels but I do not seem to be able to do this
Calling the following:
The output to the console is as expected.
But the loki output is
Can someone please point me in the right direction?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions