コード例 #1
0
ファイル: App.cs プロジェクト: ledudu/XOutput
 private void SetLoggerConfiguration()
 {
     try
     {
         if (File.Exists("nlog.config"))
         {
             LogManager.Configuration = new XmlLoggingConfiguration(XmlReader.Create(File.OpenRead("nlog.config")));
             return;
         }
     }
     catch
     {
         // Cannot create logger
     }
     LogManager.Configuration = new XmlLoggingConfiguration(XmlReader.Create(AssemblyResourceManager.GetResourceStream("XOutput.Server.nlog.config")));
 }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: simonporte/XOutput
 private void SetLoggerConfiguration()
 {
     try
     {
         if (File.Exists("nlog.config"))
         {
             LogManager.Configuration = new XmlLoggingConfiguration(XmlReader.Create(File.OpenRead("nlog.config")));
         }
     }
     catch
     {
         LogManager.Configuration = new XmlLoggingConfiguration(XmlReader.Create(AssemblyResourceManager.GetResourceStream("nlog.config")));
     }
 }