feat(logging): enable NLog only in non-development environments
This commit is contained in:
parent
6ade388cd7
commit
5843e9efa8
10
Program.cs
10
Program.cs
@ -9,10 +9,14 @@ logger.Info("Logging initialized.");
|
||||
try
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Logging.ClearProviders();
|
||||
|
||||
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
||||
builder.Host.UseNLog();
|
||||
|
||||
if (!builder.Environment.IsDevelopment())
|
||||
{
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Host.UseNLog();
|
||||
}
|
||||
|
||||
// Make sure to add the Ocelot configuration file
|
||||
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user