mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
use Serilog console logging rather than Microsoft default
This commit is contained in:
parent
40b6bf4406
commit
6224de69f2
2 changed files with 5 additions and 2 deletions
|
|
@ -44,11 +44,13 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Localization" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.10.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.11" />
|
||||
<PackageReference Include="Octokit" Version="0.32.0" />
|
||||
<PackageReference Include="Polly" Version="7.1.0" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.10" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -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<IOptions<ApplicationInsightsSettings>>().Value;
|
||||
b.AddApplicationInsights(applicationInsightsSettings.InstrumentationKey);
|
||||
|
|
|
|||
Loading…
Reference in a new issue