From 6224de69f25f627fc5c79a26ef4dc9ba9c96edc2 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 12 Jul 2019 07:54:10 -0500 Subject: [PATCH] use Serilog console logging rather than Microsoft default --- src/FilterLists.Agent/FilterLists.Agent.csproj | 4 +++- .../DependencyInjection/ServiceCollectionExtensions.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FilterLists.Agent/FilterLists.Agent.csproj b/src/FilterLists.Agent/FilterLists.Agent.csproj index b66b0bdb2..aac1ca74c 100644 --- a/src/FilterLists.Agent/FilterLists.Agent.csproj +++ b/src/FilterLists.Agent/FilterLists.Agent.csproj @@ -44,11 +44,13 @@ - + + + diff --git a/src/FilterLists.Agent/Infrastructure/DependencyInjection/ServiceCollectionExtensions.cs b/src/FilterLists.Agent/Infrastructure/DependencyInjection/ServiceCollectionExtensions.cs index 9c9534d48..4871b1958 100644 --- a/src/FilterLists.Agent/Infrastructure/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/FilterLists.Agent/Infrastructure/DependencyInjection/ServiceCollectionExtensions.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Polly; +using Serilog; namespace FilterLists.Agent.Infrastructure.DependencyInjection { @@ -60,7 +61,7 @@ private static void AddLoggingCustom(this IServiceCollection services) { services.AddLogging(b => { - b.AddConsole(); + b.AddSerilog(new LoggerConfiguration().WriteTo.Console().CreateLogger()); var applicationInsightsSettings = b.Services.BuildServiceProvider() .GetService>().Value; b.AddApplicationInsights(applicationInsightsSettings.InstrumentationKey);