feat(logging): enable NLog only in non-development environments
This commit is contained in:
parent
6ade388cd7
commit
5843e9efa8
@ -10,9 +10,13 @@ try
|
|||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
builder.Logging.ClearProviders();
|
|
||||||
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
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
|
// Make sure to add the Ocelot configuration file
|
||||||
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user