/[AnywhereTS-MSSQL]/trunk/AnywhereTS.Logging/Logging.cs
ViewVC logotype

Diff of /trunk/AnywhereTS.Logging/Logging.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/AnywhereTS.Logging/Logging.cs	2012/07/15 11:21:36	149
+++ trunk/AnywhereTS.Logging/Logging.cs	2012/07/16 10:19:21	165
@@ -19,19 +19,11 @@
         private static void Initialize()
         {
             string path = typeof(Logging).Assembly.Location.ToLower().Replace(@"\AnywhereTS.Logging.dll".ToLower(), "");
-
             string config = string.Format(@"{0}\{1}", path, "AnywhereTS.Logging.dll.config");
             //MessageBox.Show(config);
             FileInfo fi = new FileInfo(config);
-
-            if (!fi.Exists)
-            {
-                MessageBox.Show(string.Format("Logging Config does not exist!{0}{1}", System.Environment.NewLine, fi.FullName));
-            }
-            else
-            {
-                XmlConfigurator.Configure(new FileInfo(config));
-            }
+            XmlConfigurator.Configure(fi);
+            Logging.SetLogPath(string.Format(@"{0}\logs", fi.FullName));
         }
 
         #region Log access
@@ -39,12 +31,22 @@
         public static readonly ILog TSControlPanelLog = LogManager.GetLogger("AnywhereTS.TSControlPanel");
         public static readonly ILog DatabaseLog = LogManager.GetLogger("AnywhereTS.DBSupport");
 
-        //public static readonly ILog ATSAdminInstallerLog = LogManager.GetLogger("AnywhereTS.ATSAmdin.Installer");
-        //public static readonly ILog TSControlPanelInstallerLog = LogManager.GetLogger("AnywhereTS.TSControlPanel.Installer");
+        public static readonly ILog ATSAdminInstallerLog = LogManager.GetLogger("AnywhereTS.ATSAmdin.Installer");
+        public static readonly ILog TSControlPanelInstallerLog = LogManager.GetLogger("AnywhereTS.TSControlPanel.Installer");
+
+        public static readonly ILog WizardLog = LogManager.GetLogger("AnywhereTS.Wizard");
+        public static readonly ILog DefaultLog = LogManager.GetLogger("AnywhereTS.DefaultLogger");
+
         #endregion
 
+        public static void UpdateLogPath() 
+        {
+            string path = typeof(Logging).Assembly.Location.ToLower().Replace(@"\AnywhereTS.Logging.dll".ToLower(), "");
+            Logging.UpdateLogPath(path);
+        }
+        public static void UpdateLogPath(string path) { Logging.SetLogPath(path); }
 
-        public static void SetLogPath(string path)
+        private static void SetLogPath(string path)
         {
             var fileAppenders = from appender in log4net.LogManager.GetRepository().GetAppenders()
                                 where appender is FileAppender
@@ -61,6 +63,7 @@
                    }
                );
         }
+
         #region log4net help
         public static List<string> GetMessagesFromThreadContextStack(string RawContextStack)
         {

 

  ViewVC Help
Powered by ViewVC 1.1.22