Closed yohny closed 1 year ago
Hi @yohny - your message template is incorrectly constructed: even if it doesn't include any property placeholders, it should at least have one MessageTemplateTextToken
with the full text of the template in it.
Using MessageTemplateParser
to create the MessageTemplate
will sidestep any other similar problems.
thanks, MessageTemplateParser
solved the issue
I have a project where some logs are produced using
LogEvent
and I noticed that in those cases the renderd message (message template with injected values of propeties) is missing. To reproduce, try logging the following messages in regular and LogEvent fasion:Using the following
ExpressionTemplate
:"{ {@t, @l, @mt, @m, @x, ..@p} }\n"
and the result is:As you can see in the second line logged using
LogEvent
the@m
value is empty, althout it is expected to contain the rendered message (in this case the same as message template as there are no tokens present). This also happens when usingRenderedCompactJsonFormatter
- rendered message is empty.