From b97fe50958b419ab51f46c326954038366f02f06 Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Wed, 18 May 2016 17:13:59 -0400 Subject: [PATCH] Put log in more appropriate location ad create log by default --- mRemoteV1/App/Logger.cs | 16 ++++++++++------ mRemoteV1/Properties/Settings.Designer.cs | 2 +- mRemoteV1/Properties/Settings.settings | 2 +- mRemoteV1/app.config | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/mRemoteV1/App/Logger.cs b/mRemoteV1/App/Logger.cs index cc16d7949..f97f3c925 100644 --- a/mRemoteV1/App/Logger.cs +++ b/mRemoteV1/App/Logger.cs @@ -2,7 +2,11 @@ using log4net.Appender; using log4net.Config; using log4net.Repository; +#if !PORTABLE +using System; +#endif using System.IO; +using System.Windows.Forms; namespace mRemoteNG.App { @@ -47,12 +51,12 @@ namespace mRemoteNG.App private static string BuildLogFilePath() { string logFilePath = ""; - #if !PORTABLE - logFilePath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), System.Windows.Forms.Application.ProductName); - #else - logFilePath = System.Windows.Forms.Application.StartupPath; - #endif - string logFileName = Path.ChangeExtension(System.Windows.Forms.Application.ProductName, ".log"); +#if !PORTABLE + logFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Application.ProductName); +#else + logFilePath = Application.StartupPath; +#endif + string logFileName = Path.ChangeExtension(Application.ProductName, ".log"); string logFile = Path.Combine(logFilePath, logFileName); return logFile; } diff --git a/mRemoteV1/Properties/Settings.Designer.cs b/mRemoteV1/Properties/Settings.Designer.cs index bea2a49c5..536fe76e3 100644 --- a/mRemoteV1/Properties/Settings.Designer.cs +++ b/mRemoteV1/Properties/Settings.Designer.cs @@ -313,7 +313,7 @@ namespace mRemoteNG { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool WriteLogFile { get { return ((bool)(this["WriteLogFile"])); diff --git a/mRemoteV1/Properties/Settings.settings b/mRemoteV1/Properties/Settings.settings index a85dde8a1..b28b38608 100644 --- a/mRemoteV1/Properties/Settings.settings +++ b/mRemoteV1/Properties/Settings.settings @@ -75,7 +75,7 @@ - False + True False diff --git a/mRemoteV1/app.config b/mRemoteV1/app.config index c6191a2b5..a3a8387ca 100644 --- a/mRemoteV1/app.config +++ b/mRemoteV1/app.config @@ -20,7 +20,7 @@ - + @@ -109,7 +109,7 @@ - False + True False