serilog-sinks-eventlog icon indicating copy to clipboard operation
serilog-sinks-eventlog copied to clipboard

Add the ability to not log empty messages

Open bspraguetx opened this issue 1 year ago • 1 comments

We rely on the Serilog.Expressions package to create custom expressions that are used to control what messages are written to particular sink. If the expression returns false then no message details are emitted to the sink. There is no logic in this sink to bypass writing an empty message. Would you please consider adding an optional switch to the configuration that would bypass writing the message if the rendered payload is an empty string or just whitespace?

Thanks

bspraguetx avatar Jun 16 '23 14:06 bspraguetx

Hey @bspraguetx,

Unfortunately I don't have a windows machine setup any longer so I wouldn't be able to help out with this request. I'd be happy to help you through the process of submitting a patch if you're interested in trying to tackle it. There may be some other maintainers hanging around as well who could see this message.

mrbcmorris avatar Jun 26 '23 13:06 mrbcmorris