From d78e351907ceb3ddf65b4359afa3661b1cc04562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Tue, 29 Nov 2022 10:43:42 +0400 Subject: [PATCH] FixLogs --- .../GasolineTanker/GasolineTanker.csproj | 2 +- GasolineTanker/GasolineTanker/Program.cs | 2 +- GasolineTanker/GasolineTanker/appSetting.json | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/GasolineTanker/GasolineTanker/GasolineTanker.csproj b/GasolineTanker/GasolineTanker/GasolineTanker.csproj index c7e90e8..cafe1e5 100644 --- a/GasolineTanker/GasolineTanker/GasolineTanker.csproj +++ b/GasolineTanker/GasolineTanker/GasolineTanker.csproj @@ -14,7 +14,7 @@ - + diff --git a/GasolineTanker/GasolineTanker/Program.cs b/GasolineTanker/GasolineTanker/Program.cs index 3ebe324..8a03804 100644 --- a/GasolineTanker/GasolineTanker/Program.cs +++ b/GasolineTanker/GasolineTanker/Program.cs @@ -30,7 +30,7 @@ namespace GasolineTanker { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile(path: "C:\\Users\\Μΰκρθμ\\Desktop\\Σνθβεπ\\3 ρεμερςπ\\ΠΟΟ\\GasolineTanker\\GasolineTanker\\GasolineTanker\\appSetting.json", optional: false, reloadOnChange: true) + .AddJsonFile(path: "C:\\Users\\kashi\\Desktop\\RPP\\GasolineTankerBase\\Base\\GasolineTanker\\GasolineTanker\\appSetting.json", optional: false, reloadOnChange: true) .Build(); var logger = new LoggerConfiguration() diff --git a/GasolineTanker/GasolineTanker/appSetting.json b/GasolineTanker/GasolineTanker/appSetting.json index c24ea57..6d879ce 100644 --- a/GasolineTanker/GasolineTanker/appSetting.json +++ b/GasolineTanker/GasolineTanker/appSetting.json @@ -1,12 +1,20 @@ ο»Ώ{ "Serilog": { "Using": [ "Serilog.Sinks.File" ], - "MinimumLevel": "Debug", + "MinimumLevel": "Information", "WriteTo": [ { "Name": "File", - "Args": { "path": "C:\\УнивСрситСт\\2 курс\\РПП\\AntiAircraftGun\\AntiAircraftGun\\AntiAircraftGun\\bin\\Debug\\net6.0-windows\\Log.txt" } + "Args": { + "path": "Logs/log_.log", + "rollingInterval": "Day", + "outputTemplate": "[{Timestamp:HH:mm:ss.fff}]{Level:u4}: {Message:lj}{NewLine}{Exception}" + } } - ] + ], + "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ], + "Properties": { + "Application": "GasolineTanker" + } } -} +} \ No newline at end of file