I need to setup NLog when Azure Functions instantiates my assembly.
public class Startup : FunctionsStartup {
public Startup()
{
var logger = NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
}
public override void Configure(IFunctionsHostBuilder builder) {
... other setup code
builder.Services.AddLogging((loggingBuilder) =>
{
loggingBuilder.AddNLog();
});
}
}
NLog folks recommend manually shutting down the logger via NLog.LogManager.Shutdown()
.
The problem is that I am not sure how to catch the instance of Azure shutting my assembly down.
Does Azure expose a Dispose event of some sort that I am not seeing?