From 9f324759cde4288a9af5d93abfa0e1307d3543bb Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Sat, 19 Nov 2016 22:35:33 +0100 Subject: [PATCH] Added basic log4net config file --- .../Config Files/log4net.config | 29 +++++++++++++++++++ NAV Source Control/NAV Source Control.csproj | 3 ++ NAV Source Control/Program.cs | 17 ++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 NAV Source Control/Config Files/log4net.config diff --git a/NAV Source Control/Config Files/log4net.config b/NAV Source Control/Config Files/log4net.config new file mode 100644 index 0000000..f70292b --- /dev/null +++ b/NAV Source Control/Config Files/log4net.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NAV Source Control/NAV Source Control.csproj b/NAV Source Control/NAV Source Control.csproj index a47a0c1..170e428 100644 --- a/NAV Source Control/NAV Source Control.csproj +++ b/NAV Source Control/NAV Source Control.csproj @@ -52,6 +52,9 @@ + + Always + diff --git a/NAV Source Control/Program.cs b/NAV Source Control/Program.cs index 8b55cea..86bcd38 100644 --- a/NAV Source Control/Program.cs +++ b/NAV Source Control/Program.cs @@ -3,13 +3,28 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using log4net; -namespace NAV_Source_Control +namespace NAVSCM { class Program { + private static readonly ILog log = LogManager.GetLogger(typeof(Program)); + static void Main(string[] args) { + log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("Config Files\\log4net.config")); + + log.Info("Starting up..."); + + log.Debug("Debug"); + log.Warn("Warn"); + log.Error("Error"); + log.Fatal("Fatal"); + + log.Info("Shutting down..."); + + Console.ReadLine(); } } }