/[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

revision 149 by william, Sun Jul 15 11:21:36 2012 UTC revision 165 by william, Mon Jul 16 10:19:21 2012 UTC
# Line 19  namespace AnywhereTS Line 19  namespace AnywhereTS
19          private static void Initialize()          private static void Initialize()
20          {          {
21              string path = typeof(Logging).Assembly.Location.ToLower().Replace(@"\AnywhereTS.Logging.dll".ToLower(), "");              string path = typeof(Logging).Assembly.Location.ToLower().Replace(@"\AnywhereTS.Logging.dll".ToLower(), "");
   
22              string config = string.Format(@"{0}\{1}", path, "AnywhereTS.Logging.dll.config");              string config = string.Format(@"{0}\{1}", path, "AnywhereTS.Logging.dll.config");
23              //MessageBox.Show(config);              //MessageBox.Show(config);
24              FileInfo fi = new FileInfo(config);              FileInfo fi = new FileInfo(config);
25                XmlConfigurator.Configure(fi);
26              if (!fi.Exists)              Logging.SetLogPath(string.Format(@"{0}\logs", fi.FullName));
             {  
                 MessageBox.Show(string.Format("Logging Config does not exist!{0}{1}", System.Environment.NewLine, fi.FullName));  
             }  
             else  
             {  
                 XmlConfigurator.Configure(new FileInfo(config));  
             }  
27          }          }
28    
29          #region Log access          #region Log access
# Line 39  namespace AnywhereTS Line 31  namespace AnywhereTS
31          public static readonly ILog TSControlPanelLog = LogManager.GetLogger("AnywhereTS.TSControlPanel");          public static readonly ILog TSControlPanelLog = LogManager.GetLogger("AnywhereTS.TSControlPanel");
32          public static readonly ILog DatabaseLog = LogManager.GetLogger("AnywhereTS.DBSupport");          public static readonly ILog DatabaseLog = LogManager.GetLogger("AnywhereTS.DBSupport");
33    
34          //public static readonly ILog ATSAdminInstallerLog = LogManager.GetLogger("AnywhereTS.ATSAmdin.Installer");          public static readonly ILog ATSAdminInstallerLog = LogManager.GetLogger("AnywhereTS.ATSAmdin.Installer");
35          //public static readonly ILog TSControlPanelInstallerLog = LogManager.GetLogger("AnywhereTS.TSControlPanel.Installer");          public static readonly ILog TSControlPanelInstallerLog = LogManager.GetLogger("AnywhereTS.TSControlPanel.Installer");
36    
37            public static readonly ILog WizardLog = LogManager.GetLogger("AnywhereTS.Wizard");
38            public static readonly ILog DefaultLog = LogManager.GetLogger("AnywhereTS.DefaultLogger");
39    
40          #endregion          #endregion
41    
42            public static void UpdateLogPath()
43            {
44                string path = typeof(Logging).Assembly.Location.ToLower().Replace(@"\AnywhereTS.Logging.dll".ToLower(), "");
45                Logging.UpdateLogPath(path);
46            }
47            public static void UpdateLogPath(string path) { Logging.SetLogPath(path); }
48    
49          public static void SetLogPath(string path)          private static void SetLogPath(string path)
50          {          {
51              var fileAppenders = from appender in log4net.LogManager.GetRepository().GetAppenders()              var fileAppenders = from appender in log4net.LogManager.GetRepository().GetAppenders()
52                                  where appender is FileAppender                                  where appender is FileAppender
# Line 61  namespace AnywhereTS Line 63  namespace AnywhereTS
63                     }                     }
64                 );                 );
65          }          }
66    
67          #region log4net help          #region log4net help
68          public static List<string> GetMessagesFromThreadContextStack(string RawContextStack)          public static List<string> GetMessagesFromThreadContextStack(string RawContextStack)
69          {          {

Legend:
Removed from v.149  
changed lines
  Added in v.165

  ViewVC Help
Powered by ViewVC 1.1.22