mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Put log in more appropriate location
ad create log by default
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
2
mRemoteV1/Properties/Settings.Designer.cs
generated
2
mRemoteV1/Properties/Settings.Designer.cs
generated
@@ -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"]));
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="WriteLogFile" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="UseCustomPuttyPath" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</root>
|
||||
|
||||
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
|
||||
<file value="${USERPROFILE}\AppData\Local\mRemoteNG\mRemoteNG.log"/>
|
||||
<file value="${APPDATA}\mRemoteNG\mRemoteNG.log"/>
|
||||
<!-- Example using environment variables in params -->
|
||||
<!-- <file value="${TMP}\log-file.txt" /> -->
|
||||
<appendToFile value="true"/>
|
||||
@@ -109,7 +109,7 @@
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="WriteLogFile" serializeAs="String">
|
||||
<value>False</value>
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="UseCustomPuttyPath" serializeAs="String">
|
||||
<value>False</value>
|
||||
|
||||
Reference in New Issue
Block a user