mirror of
https://github.com/ckaczor/WorkIndicator.git
synced 2026-01-13 17:23:18 -05:00
Set specific log path
This commit is contained in:
@@ -4,6 +4,7 @@ using Common.Wpf.Extensions;
|
|||||||
using Serilog;
|
using Serilog;
|
||||||
using Squirrel;
|
using Squirrel;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -26,9 +27,15 @@ namespace WorkIndicator
|
|||||||
{
|
{
|
||||||
SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
|
SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
|
||||||
|
|
||||||
|
var location = Assembly.GetEntryAssembly().Location;
|
||||||
|
|
||||||
|
var path = Path.GetDirectoryName(location);
|
||||||
|
|
||||||
|
var logFile = Path.Combine(path, "log.txt");
|
||||||
|
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Debug()
|
.MinimumLevel.Debug()
|
||||||
.WriteTo.File("log.txt", rollingInterval: RollingInterval.Day)
|
.WriteTo.File(logFile, rollingInterval: RollingInterval.Day)
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
Log.Logger.Debug($"Startup");
|
Log.Logger.Debug($"Startup");
|
||||||
|
|||||||
Reference in New Issue
Block a user