diff --git a/.azure/modules/functionApp/slackNotifier.bicep b/.azure/modules/functionApp/slackNotifier.bicep index 970e751ad..fbd0629eb 100644 --- a/.azure/modules/functionApp/slackNotifier.bicep +++ b/.azure/modules/functionApp/slackNotifier.bicep @@ -165,7 +165,7 @@ var query = ''' | where customDimensions.RequestPath !startswith "/health" | summarize Count = count() by - Environment = tostring(customDimensions.AspNetCoreEnvironment), + Environment = tostring(customDimensions.EnvironmentName), Type = itemType, problemId, tostring(customDimensions.MessageTemplate), diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/Digdir.Domain.Dialogporten.GraphQL.csproj b/src/Digdir.Domain.Dialogporten.GraphQL/Digdir.Domain.Dialogporten.GraphQL.csproj index 26aa152a8..d0f5abf8a 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/Digdir.Domain.Dialogporten.GraphQL.csproj +++ b/src/Digdir.Domain.Dialogporten.GraphQL/Digdir.Domain.Dialogporten.GraphQL.csproj @@ -10,6 +10,7 @@ + diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/Program.cs b/src/Digdir.Domain.Dialogporten.GraphQL/Program.cs index 68a417bb3..7753936ac 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/Program.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/Program.cs @@ -24,6 +24,7 @@ Log.Logger = new LoggerConfiguration() .MinimumLevel.Warning() .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces) .CreateBootstrapLogger(); @@ -51,6 +52,7 @@ static void BuildAndRun(string[] args, TelemetryConfiguration telemetryConfigura .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces)); diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/Properties/launchSettings.json b/src/Digdir.Domain.Dialogporten.GraphQL/Properties/launchSettings.json index fa20d39ed..2743bc542 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/Properties/launchSettings.json +++ b/src/Digdir.Domain.Dialogporten.GraphQL/Properties/launchSettings.json @@ -8,7 +8,7 @@ "launchUrl": "graphql", "applicationUrl": "http://localhost:5181", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" } } } diff --git a/src/Digdir.Domain.Dialogporten.Janitor/Digdir.Domain.Dialogporten.Janitor.csproj b/src/Digdir.Domain.Dialogporten.Janitor/Digdir.Domain.Dialogporten.Janitor.csproj index a82cce35b..3e2743ee6 100644 --- a/src/Digdir.Domain.Dialogporten.Janitor/Digdir.Domain.Dialogporten.Janitor.csproj +++ b/src/Digdir.Domain.Dialogporten.Janitor/Digdir.Domain.Dialogporten.Janitor.csproj @@ -18,6 +18,7 @@ + diff --git a/src/Digdir.Domain.Dialogporten.Janitor/Program.cs b/src/Digdir.Domain.Dialogporten.Janitor/Program.cs index 3ae871167..37bb99c59 100644 --- a/src/Digdir.Domain.Dialogporten.Janitor/Program.cs +++ b/src/Digdir.Domain.Dialogporten.Janitor/Program.cs @@ -15,6 +15,7 @@ Log.Logger = new LoggerConfiguration() .MinimumLevel.Warning() .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights( TelemetryConfiguration.CreateDefault(), @@ -51,6 +52,7 @@ static void BuildAndRun(string[] args) .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights( services.GetRequiredService(), diff --git a/src/Digdir.Domain.Dialogporten.Service/Digdir.Domain.Dialogporten.Service.csproj b/src/Digdir.Domain.Dialogporten.Service/Digdir.Domain.Dialogporten.Service.csproj index 25015f45c..5edb017d4 100644 --- a/src/Digdir.Domain.Dialogporten.Service/Digdir.Domain.Dialogporten.Service.csproj +++ b/src/Digdir.Domain.Dialogporten.Service/Digdir.Domain.Dialogporten.Service.csproj @@ -2,6 +2,7 @@ + diff --git a/src/Digdir.Domain.Dialogporten.Service/Program.cs b/src/Digdir.Domain.Dialogporten.Service/Program.cs index a0d9de702..3fffde09d 100644 --- a/src/Digdir.Domain.Dialogporten.Service/Program.cs +++ b/src/Digdir.Domain.Dialogporten.Service/Program.cs @@ -16,6 +16,7 @@ Log.Logger = new LoggerConfiguration() .MinimumLevel.Warning() .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces) .CreateBootstrapLogger(); @@ -43,6 +44,7 @@ static void BuildAndRun(string[] args, TelemetryConfiguration telemetryConfigura .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) .Enrich.FromLogContext() + .Enrich.WithEnvironmentName() .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces)); builder.Configuration diff --git a/src/Digdir.Domain.Dialogporten.Service/Properties/launchSettings.json b/src/Digdir.Domain.Dialogporten.Service/Properties/launchSettings.json index 0570a2097..f4ffc7d2f 100644 --- a/src/Digdir.Domain.Dialogporten.Service/Properties/launchSettings.json +++ b/src/Digdir.Domain.Dialogporten.Service/Properties/launchSettings.json @@ -4,9 +4,9 @@ "commandName": "Project", "launchBrowser": false, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" }, "applicationUrl": "https://localhost:56841;http://localhost:56842" } } -} \ No newline at end of file +} diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj b/src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj index 9465e2e14..08ec98787 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj +++ b/src/Digdir.Domain.Dialogporten.WebApi/Digdir.Domain.Dialogporten.WebApi.csproj @@ -14,6 +14,7 @@ + diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Program.cs b/src/Digdir.Domain.Dialogporten.WebApi/Program.cs index 30e60ba03..d08c68cc2 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Program.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Program.cs @@ -29,6 +29,7 @@ var telemetryConfiguration = TelemetryConfiguration.CreateDefault(); Log.Logger = new LoggerConfiguration() .MinimumLevel.Warning() + .Enrich.WithEnvironmentName() .Enrich.FromLogContext() .WriteTo.Console(formatProvider: CultureInfo.InvariantCulture) .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces) @@ -61,6 +62,7 @@ static void BuildAndRun(string[] args, TelemetryConfiguration telemetryConfigura .MinimumLevel.Warning() .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) + .Enrich.WithEnvironmentName() .Enrich.FromLogContext() .WriteTo.ApplicationInsights(telemetryConfiguration, TelemetryConverter.Traces)); diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Properties/launchSettings.json b/src/Digdir.Domain.Dialogporten.WebApi/Properties/launchSettings.json index 3d2bf5033..e80a461c2 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Properties/launchSettings.json +++ b/src/Digdir.Domain.Dialogporten.WebApi/Properties/launchSettings.json @@ -8,7 +8,7 @@ "launchUrl": "swagger", "applicationUrl": "http://localhost:5123", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" } }, "https": { @@ -18,7 +18,7 @@ "launchUrl": "swagger", "applicationUrl": "https://localhost:7214;http://localhost:5123", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" } } }