we use a user-defined Serilog Sink that sends emails. We want to exclude some messages from the log to this sink. In earlier versions this was possible via the serilog.user.config file
<add key="serilog:write-to:FFSmtp.filter" value="Failed to build models" />
but since Umbraco 9 I don't see a way to configure that.
This filters messages for all sinks. I could live with that, but I can't find any documentation on how to apply filter expressions to the log message. This stack overflow post suggests using @Message or @m but both don't work.
Howto configure a log filter
Hello everyone,
we use a user-defined Serilog Sink that sends emails. We want to exclude some messages from the log to this sink. In earlier versions this was possible via the serilog.user.config file
but since Umbraco 9 I don't see a way to configure that.
The serilog docu suggests using a filter section:
This filters messages for all sinks. I could live with that, but I can't find any documentation on how to apply filter expressions to the log message. This stack overflow post suggests using @Message or @m but both don't work.
Do you have an idea how to solve this?
-mm
do you have the Serilog.Expressions package installed?
Serilog.Expressins comes as dependency of Umbraco.Cms.Infrastructure.
maybe the comparison is failing, perhaps try something like
is working on a reply...