From 2f5c5771340ed96ce1784b3ee887f87f338092d2 Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl Date: Thu, 22 Oct 2020 01:29:08 +0100 Subject: [PATCH] Add some basic logging --- ExpenseTracker.Api/ExpenseTracker.csproj | 15 ++++++++------- ExpenseTracker.Api/Startup.cs | 2 ++ ExpenseTracker.Api/appsettings.json | 3 +++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ExpenseTracker.Api/ExpenseTracker.csproj b/ExpenseTracker.Api/ExpenseTracker.csproj index f7ea5be..67d1c52 100644 --- a/ExpenseTracker.Api/ExpenseTracker.csproj +++ b/ExpenseTracker.Api/ExpenseTracker.csproj @@ -4,13 +4,14 @@ netcoreapp3.1 - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/ExpenseTracker.Api/Startup.cs b/ExpenseTracker.Api/Startup.cs index b88f3f7..65170d0 100644 --- a/ExpenseTracker.Api/Startup.cs +++ b/ExpenseTracker.Api/Startup.cs @@ -22,6 +22,8 @@ public Startup(IConfiguration configuration, IWebHostEnvironment env) public void ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(); + services.AddControllers(); if (env.IsDevelopment() || env.IsProduction()) // TODO: define production datacontext and cors policy { diff --git a/ExpenseTracker.Api/appsettings.json b/ExpenseTracker.Api/appsettings.json index 81ff877..efea550 100644 --- a/ExpenseTracker.Api/appsettings.json +++ b/ExpenseTracker.Api/appsettings.json @@ -1,4 +1,7 @@ { + "ApplicationInsights": { + "InstrumentationKey": "fakekey" + }, "Logging": { "LogLevel": { "Default": "Information",