Logs - Write logs to program data folder, more consistent & closes #530

This commit is contained in:
Robert committed 2021-01-21 19:41:38 +01:00
1 parent de5b8e4458
commit 75b4b72f9f
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ namespace Artemis.Core.Ninject
private static readonly ILogger Logger = new LoggerConfiguration() private static readonly ILogger Logger = new LoggerConfiguration()
.Enrich.FromLogContext() .Enrich.FromLogContext()
.Enrich.WithDemystifiedStackTraces() .Enrich.WithDemystifiedStackTraces()
.WriteTo.File("Logs/Artemis log-.txt", .WriteTo.File(Constants.DataFolder + "logs/Artemis log-.txt",
rollingInterval: RollingInterval.Day, rollingInterval: RollingInterval.Day,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}") outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}")
.WriteTo.Debug() .WriteTo.Debug()
@@ -245,7 +245,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.General
{ {
try try
{ {
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs")); Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(Constants.DataFolder, "Logs"));
} }
catch (Exception e) catch (Exception e)
{ {
@@ -59,7 +59,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
{ {
try try
{ {
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs")); Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(Constants.DataFolder, "Logs"));
} }
catch (Exception e) catch (Exception e)
{ {
@@ -86,7 +86,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
{ {
try try
{ {
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs")); Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(Constants.DataFolder, "Logs"));
} }
catch (Exception e) catch (Exception e)
{ {