File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,12 @@ public static MainWindow Create(string[] args)
75
75
if ( mainWindow != null )
76
76
throw new ExceptionFreeserf ( ErrorSystemType . Application , "A main window can not be created twice." ) ;
77
77
78
+ string logDirectory = string . Empty ;
79
+
78
80
try
79
81
{
80
82
#if ! DEBUG
81
- string logDirectory = FileSystem . Paths . IsWindows ( ) ? Program . ExecutablePath : "/var/log/ freeserf.net ";
83
+ logDirectory = FileSystem . Paths . IsWindows ( ) ? Program . ExecutablePath : Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) + "/ freeserf";
82
84
string logPath = Path . Combine ( logDirectory , UserConfig . DefaultLogFile ) ;
83
85
Directory . CreateDirectory ( logDirectory ) ;
84
86
Log . SetStream ( new LogFileStream ( logPath ) ) ;
@@ -114,7 +116,7 @@ public static MainWindow Create(string[] args)
114
116
string logFile = string . IsNullOrWhiteSpace ( UserConfig . Logging . LogFileName ) ? UserConfig . DefaultLogFile : UserConfig . Logging . LogFileName ;
115
117
116
118
if ( ! Path . IsPathRooted ( logFile ) )
117
- logFile = Path . Combine ( Program . ExecutablePath , logFile ) ;
119
+ logFile = Path . Combine ( logDirectory , logFile ) ;
118
120
119
121
Log . SetStream ( new LogFileStream ( logFile ) ) ;
120
122
Log . MaxSize = UserConfig . Logging . MaxLogSize ;
You can’t perform that action at this time.
0 commit comments