Skip to content

Instantly share code, notes, and snippets.

@alistairjevans
Created October 4, 2019 14:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alistairjevans/ebfea70fe9a94a196292ce87f3e57972 to your computer and use it in GitHub Desktop.
Save alistairjevans/ebfea70fe9a94a196292ce87f3e57972 to your computer and use it in GitHub Desktop.
Startup with Nlog ILogger
public class Startup
{
public Startup(IConfiguration configuration)
{
// Get the factory for ILogger instances.
var nlogLoggerProvider = new NLogLoggerProvider();
// Create an ILogger.
Logger = nlogLoggerProvider.CreateLogger(typeof(Startup).FullName);
}
public void ConfigureServices(IServiceCollection services)
{
Logger.LogInformation("Registering Services");
// And the rest
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment