We have a Web application, developed with ASP.Net Core and deployed on Azure using Docker container. The Web App uses serilog library (https://serilog.net/) as internal logging engine. The configuration of Serilog is stored in the file serilog.json, included in the Visual Studio Solution Explorer and, obviously, in the final Docker container.
Using a special admin panel included in the Web App, an administrator can change the active Serilog log level to any supported value (Fatal, Error, Warning and so on). This feature simply updates the file serilog.json, and ASP.NET Core reloads on-the-fly the new log level. It works like a charm, but now the problems begins.
We use Azure DevOps to deploy every nighty a new version of our Web App, so every night the current Docker container is overwritten with the newest one. Also the file serilog.json, so every night we lose the log level configuration.
What are we wrong with this approach? We need to move 'serilog.json' outside the Docker container and store it in another location? Any idea?
Thanks for your help, support and discussion!