Is the lack of any defined sinks the proper way to disable Serilog?
I did see this question:
But mine's more about how to configure Serilog when releasing a product, so that by default no log files are created when the product is used, and the calls to Serilog have as little overhead as possible.
We configure Serilog using app/web config files, so in a Debug build it looks something like this:
<add key="serilog:minimum-level" value="Verbose" />
<add key="serilog:write-to:RollingFile.pathFormat"
value="%ProgramData%\Product\debug\AppName-{Date}.log" />
<add key="serilog:write-to:RollingFile.retainedFileCountLimit" value="10" />
These lines are processed like so:
new LoggerConfiguration().ReadFrom.AppSettings()...
When we generate the app/web config files to ship with the product, is it sufficient to remove any sinks from the config files to effectively disable Serilog?
I guess I'm wondering if there's some sort of "off" setting so that the very first thing a call to Serilog does is "if (off) return;", or something along those lines? Or is the lack of any defined sinks basically the same thing? My goal is to configure things so all the calls to Serilog are as fast as possible when we have logging "disabled".