From 9c0a1678a05667a6a5606e630b5b3a9ed52922e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=20=D0=91=D0=BE=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Thu, 1 Dec 2022 23:00:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=20=D0=BA=20pull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarmlyShip/WarmlyShip/Program.cs | 3 ++- WarmlyShip/WarmlyShip/serilogConfig.json | 29 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/WarmlyShip/WarmlyShip/Program.cs b/WarmlyShip/WarmlyShip/Program.cs index 8f659fc..ef09eae 100644 --- a/WarmlyShip/WarmlyShip/Program.cs +++ b/WarmlyShip/WarmlyShip/Program.cs @@ -1,3 +1,4 @@ +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Serilog; @@ -30,7 +31,7 @@ namespace WarmlyShip { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile(path: "serilogConfig.json", optional: false, reloadOnChange: true) .Build(); var logger = new LoggerConfiguration() diff --git a/WarmlyShip/WarmlyShip/serilogConfig.json b/WarmlyShip/WarmlyShip/serilogConfig.json index 8272717..3825ce1 100644 --- a/WarmlyShip/WarmlyShip/serilogConfig.json +++ b/WarmlyShip/WarmlyShip/serilogConfig.json @@ -1,17 +1,16 @@ { - "Serilog": { - "Using": [ "Serilog.Sinks.File" ], - "MinimumLevel": "Information", - "WriteTo": [ - { - "Name": "File", - "Args": { - "path": "Logs/log_.log", - "rollingInterval": "Day", - "outputTemplate": "{Level:u4}: {Message:lj} [{Timestamp:HH:mm:ss.fff}]{NewLine}" - } + "Serilog": { + "Using": [ "Serilog.Sinks.File" ], + "MinimumLevel": "Information", + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "Logs/log_.log", + "rollingInterval": "Day", + "outputTemplate": "[{Timestamp:HH:mm:ss.fff}]{Level:u4}: {Message:lj}{NewLine}{Exception}" } - ], - "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ] - } - } \ No newline at end of file + } + ] + } +} \ No newline at end of file