From 942bf7d8cb13c16c9a79822b0c3c5a7c336951fa Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Thu, 16 Dec 2021 17:01:45 +0100 Subject: [PATCH] moved log4net config into its own file --- mRemoteNG/App/Logger.cs | 4 +++- mRemoteNG/app.config | 20 -------------------- mRemoteNG/log4net.config | 20 ++++++++++++++++++++ mRemoteNG/mRemoteNG.csproj | 3 +++ 4 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 mRemoteNG/log4net.config diff --git a/mRemoteNG/App/Logger.cs b/mRemoteNG/App/Logger.cs index 500987d0..7981cff6 100644 --- a/mRemoteNG/App/Logger.cs +++ b/mRemoteNG/App/Logger.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.IO; +using System.Reflection; using System.Windows.Forms; using log4net; using log4net.Appender; @@ -35,6 +36,7 @@ namespace mRemoteNG.App public void SetLogPath(string path) { var repository = LogManager.GetRepository("mRemoteNG"); + XmlConfigurator.Configure(repository, new FileInfo("log4net.config")); var appenders = repository.GetAppenders(); foreach (var appender in appenders) diff --git a/mRemoteNG/app.config b/mRemoteNG/app.config index 9ae87a84..4fd0b838 100644 --- a/mRemoteNG/app.config +++ b/mRemoteNG/app.config @@ -19,26 +19,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/mRemoteNG/log4net.config b/mRemoteNG/log4net.config new file mode 100644 index 00000000..1f272e70 --- /dev/null +++ b/mRemoteNG/log4net.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mRemoteNG/mRemoteNG.csproj b/mRemoteNG/mRemoteNG.csproj index 5a615da4..4657a215 100644 --- a/mRemoteNG/mRemoteNG.csproj +++ b/mRemoteNG/mRemoteNG.csproj @@ -213,6 +213,9 @@ Always + + Always + SettingsSingleFileGenerator Settings.Designer.cs