We use Serilog to register elements in db using the Windows service, and users wanted to be able to manually start, so we made a button (on the web page) to call the same code (as a module, not the service itself).
When we added db to the initialization code so that the code continues to add db to the log table, it also logs all http traffic after that. Therefore, after running this code, we want to "turn off" Logger running on a web server. Is there an easy way to do this?
Log.Logger = new LoggerConfiguration() .WriteTo.MSSqlServer(ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString, "LOGS") .CreateLogger();
source share