コード例 #1
0
        public static bool CheckLogConfig()
        {
            var logConfig = ReadLogConfig();

            foreach (var item in RequiredConfigItems.Where(required => logConfig.Items.All(x => x.Name != required.Name)))
            {
                logConfig.Add(item);
            }
            logConfig.Verify();
            if (logConfig.Updated)
            {
                WriteLogConfig(logConfig);
            }
            return(logConfig.Updated);
        }
コード例 #2
0
 private static bool CheckLogConfig()
 {
     try
     {
         var logConfig = ReadLogConfig();
         foreach (var item in RequiredConfigItems.Where(required => logConfig.Items.All(x => x.Name != required.Name)))
         {
             logConfig.Add(item);
         }
         logConfig.Verify();
         if (logConfig.Updated)
         {
             WriteLogConfig(logConfig);
         }
         return(logConfig.Updated);
     }
     catch (Exception e)
     {
         Log.Error(e);
         throw;
     }
 }