Skip to content

Commit 9fc9beb

Browse files
author
Brian Cummings
committed
Logging fix attempt
1 parent 0664e46 commit 9fc9beb

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sonarlint.connectedMode.project": {
3+
"connectionId": "pathfinderhonormanager",
4+
"projectKey": "PathfinderHonorManager_PathfinderHonorManagerAPI"
5+
}
6+
}

PathfinderHonorManager/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
2626
logging.AddConsole();
2727
logging.AddDebug();
2828
logging.AddAzureWebAppDiagnostics();
29+
logging.AddApplicationInsights();
2930
})
3031
.ConfigureServices(services =>
3132
services.Configure<AzureFileLoggerOptions>(options =>
3233
{
3334
options.FileName = "azure-diagnostics-";
3435
options.FileSizeLimit = 50 * 1024;
3536
options.RetainedFileCountLimit = 5;
37+
options.OutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}";
3638
})
3739
.Configure<AzureBlobLoggerOptions>(options =>
3840
{
3941
options.BlobName = "log.txt";
42+
options.OutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}";
4043
}));
4144
}
4245
}

PathfinderHonorManager/Startup.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ public void ConfigureServices(IServiceCollection services)
5656

5757
if (!Environment.IsDevelopment())
5858
{
59-
services.AddApplicationInsightsTelemetry();
59+
services.AddApplicationInsightsTelemetry(options =>
60+
{
61+
options.EnableAdaptiveSampling = false;
62+
options.EnableQuickPulseMetricStream = true;
63+
options.EnablePerformanceCounterCollectionModule = true;
64+
options.EnableDependencyTrackingTelemetryModule = true;
65+
options.EnableRequestTrackingTelemetryModule = true;
66+
});
6067
}
6168

6269
services.AddAuthorization(options =>

PathfinderHonorManager/appsettings.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
},
66
"Logging": {
77
"LogLevel": {
8-
"Default": "Warning",
9-
"Microsoft": "Error",
8+
"Default": "Information",
9+
"Microsoft": "Information",
1010
"Microsoft.Hosting.Lifetime": "Information",
11-
"Microsoft.EntityFrameworkCore.Database": "Warning"
11+
"Microsoft.EntityFrameworkCore.Database": "Information",
12+
"PathfinderHonorManager": "Information"
1213
}
1314
},
1415
"AllowedHosts": "*",

0 commit comments

Comments
 (0)