.Net 4.8 C# API, currently writes its logs to our database using NLog, which is all working.
However, I have now set the log level to pull the value from our web.config. (Which I got working with some help: NLog config file – pull value from WebConfig/App service config)
Using: https://github.com/NLog/NLog/wiki/AppSetting-Layout-Renderer
Which is all working so I have a values in web.config
<add key="NLog_Record" value="Info" />
then in NLog I say:
<rules>
<logger name="Log" minlevel="${appsetting:name=NLog_Record:default=None}" writeTo="DatabaseName" />
</rules>
which going by the above will only log the info messages, and this all works great.
However I have pushed our changes to app service. and tested from there adding NLog_Record
to app service configuration, logging info for Dev app service and Error for QA App Service, and this all works great.
However, my questions is when I change the NLog_Record value on the app service config, to say for example ‘Error’ instead of ‘Info’ and save, this restarts the app service.
I do not want to restart the app service.
I have been looking for a work around but am struggling, has anyone any ideas? Thanks for any replies.