Library does not log extra exception detail for Console Logger #86
-
When using this setup, the extra exception properties are not output
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Strange, could you prove a very small reproduction? |
Beta Was this translation helpful? Give feedback.
-
Simple example:
With packages:
Gives this output:
But I would have expected to see more exception detail than exception.ToString() gives. For example I would expect to see the data properties in the logged error, based on the documentation for this library. |
Beta Was this translation helpful? Give feedback.
-
Hi @eloisetaylor5693 , thanks for reaching out to us.
You need to specify custom template including
Then your output will look like that:
What's more, many other sinks are the same. On the other hand, I think that you got a point, that we could be explicit about it in the docs. I will add some guidance regarding the topic. Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
I have extended the |
Beta Was this translation helpful? Give feedback.
Hi @eloisetaylor5693 , thanks for reaching out to us.
Serilog.Sinks.Console
sink's default output template does not display enriched properties at all. Not forSerilog.Exceptions
and not for any other sink (like standardEnrich.FromLogContext()
orEnrich.WithProperty
).You need to specify custom template including
Properties
like that:Then your output will look like that: