Open adaskos-signal opened 11 months ago
Hi there and welcome to this repository!
A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.
Thanks for the suggestion and sorry for the late reply.
I've seen message templates used for non-structured log events, e.g. Serilog.Sinks.Console, but I haven't seen them used yet for structured log events. If you find a sink that features this combination, preferably by the author of Serilog, please let me know and I'll take a look at it.
Hi there. I'm certainly not an expert. I've used about 5 sinks so far in my projects.
I believe you're right, a structured message shouldn't require a message template.
But how does one go with extending the message with extra info, if he so wants?
log2console
is not so feature rich and controlling the message
helps. Even in seq
one might want to extend the logged, without the need to expand to see the parameters.
If you see no value in it, it's ok. I thought it might be an easy extension for whoever wants something similar.
I think the option we currently have is to take inspiration from one of the existing text formatters (found here), and adapt it to your needs. Please let me know if you encounter any problems with the adaptation.
Problem
There doesn't seem to be a way to combine
log4j
/log4net
formatters with a template. TheUdp
extension that accepts a template usesMessageTemplateTextFormatter
directly and doesn't produce an XML message.Feature request
It would be helpful if we extended both
log4j
/log4net
formatters to accept a template and use it to enhance thelog4j:message
according to it.Proposed solution
We can add an optional
outputTemplate
in bothLog4jTextFormatter
andLog4netTextFormatter
constructors, and then use Serilog'sMessageTemplateTextFormatter
internally to produce the message attribute, while keeping the rest as is