From 7937590fd9791c4cf6fbe15ad716b823e53f58fb Mon Sep 17 00:00:00 2001 From: Christoffer Aske Date: Tue, 5 Oct 2021 20:28:12 +0200 Subject: Changed path of logs from "exe path" to "application path" --- src/slskd/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 9590ed48..a4ae699e 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -225,7 +225,7 @@ namespace slskd outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] [{SoulseekContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") .WriteTo.Async(config => config.File( - Path.Combine(AppContext.BaseDirectory, "logs", $"{AppName}-.log"), + Path.Combine(OptionsAtStartup.Directories.App, "logs", $"{AppName}-.log"), outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}", rollingInterval: RollingInterval.Day)) .WriteTo.Conditional( -- cgit v1.2.3 From 3868570c571a631773c065ddad470c8077a5869e Mon Sep 17 00:00:00 2001 From: Christoffer Aske Date: Thu, 7 Oct 2021 19:57:30 +0200 Subject: Moved directory verification to above the logger initialization --- src/slskd/Program.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index a4ae699e..5690051b 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -212,6 +212,18 @@ namespace slskd return; } + try + { + VerifyDirectory(OptionsAtStartup.Directories.App, createIfMissing: true, verifyWriteable: true); + VerifyDirectory(OptionsAtStartup.Directories.Incomplete, createIfMissing: true, verifyWriteable: true); + VerifyDirectory(OptionsAtStartup.Directories.Downloads, createIfMissing: true, verifyWriteable: true); + } + catch (Exception ex) + { + Console.WriteLine($"Filesystem exception: {ex.Message}"); + return; + } + Log.Logger = (OptionsAtStartup.Debug ? new LoggerConfiguration().MinimumLevel.Debug() : new LoggerConfiguration().MinimumLevel.Information()) .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System.Net.Http.HttpClient", OptionsAtStartup.Debug ? LogEventLevel.Warning : LogEventLevel.Fatal) @@ -237,18 +249,6 @@ namespace slskd var logger = Log.ForContext(typeof(Program)); - try - { - VerifyDirectory(OptionsAtStartup.Directories.App, createIfMissing: true, verifyWriteable: true); - VerifyDirectory(OptionsAtStartup.Directories.Incomplete, createIfMissing: true, verifyWriteable: true); - VerifyDirectory(OptionsAtStartup.Directories.Downloads, createIfMissing: true, verifyWriteable: true); - } - catch (Exception ex) - { - logger.Error(ex, "Filesystem exception: {Message}", ex.Message); - return; - } - if (!OptionsAtStartup.NoLogo) { PrintLogo(Version); -- cgit v1.2.3