亚洲AV日韩AⅤ综合手机在线观看,激情婷婷久久综合色,欧美色五月婷婷久久,久久国产精品99久久人人澡

  • <abbr id="uk6uq"><abbr id="uk6uq"></abbr></abbr>
  • <tbody id="uk6uq"></tbody>
  • Log4net工程使用備忘

    時(shí)間:2024-07-19 23:45:17 ACCP培訓(xùn) 我要投稿
    • 相關(guān)推薦

    關(guān)于Log4net工程使用備忘

      為了方便廣大計(jì)算機(jī)愛(ài)好者,下面是小編整理的關(guān)于Log4net工程中的使用備忘,歡迎參考!

      (1):引用log4net

      (2):using log4net;

      (3):構(gòu)造函數(shù)中

      static CoreLogging()

      {

      log4net.Config.XmlConfigurator.Configure();

      }

      (4):private const string UnknownDeviceCategory = "UnknownDevice";

      private const string AlarmCategory = "Alarm";

      private const string GeneralCategory = "Trace";

      private const string ScriptCategory = "Script";

      private const string ConfigCategory = "Config";

      private const string ScanCategory = "Scan";

      private const string UdpCategory = "UdpSender";

      private const string MessageMergeCategory = "MessageMerge";

      private static ILog traceLog = LogManager.GetLogger(GeneralCategory);

      private static ILog scriptLog = LogManager.GetLogger(ScriptCategory);

      private static ILog configLog = LogManager.GetLogger(ConfigCategory);

      private static ILog scanLog = LogManager.GetLogger(ScanCategory);

      private static ILog messageMergeLog = LogManager.GetLogger(MessageMergeCategory);

      private static ILog udpLog = LogManager.GetLogger(UdpCategory);

      private static ILog alarmLog = LogManager.GetLogger(AlarmCategory);

      private static ILog unknownDeviceLog = LogManager.GetLogger(UnknownDeviceCategory);

      private static void Log(ILog logger, Object message, Priority priority)

      {

      switch (priority)

      {

      case Priority.DEBUG:

      logger.Debug(message);

      break;

      case Priority.INFO:

      logger.Info(message);

      break;

      case Priority.WARN:

      logger.Warn(message);

      break;

      case Priority.ERROR:

      logger.Error(message);

      break;

      case Priority.FATAL:

      logger.Fatal(message);

      break;

      }

      }

      public static void LogMessageMergeLog(object message, Priority priority)

      {

      Log(messageMergeLog, message, priority);

      }

      ///

      /// 通過(guò)Udp發(fā)送日志

      ///

      /// 要發(fā)送的消息內(nèi)容

      /// 優(yōu)先級(jí)

      public static void SendLogViaUdp(object message, Priority priority)

      {

      Log(udpLog, message, priority);

      }

      其他的略。

      配置文件中需要配置如下

      其他略

      下面為各個(gè)動(dòng)作。Trace類型

    【Log4net工程使用備忘】相關(guān)文章:

    2016韓國(guó)冬季游學(xué)備忘09-09

    工程機(jī)械使用壽命探討06-15

    BEC中級(jí)寫作指導(dǎo):備忘錄的寫法10-12

    1歲以下寶寶衛(wèi)生護(hù)理備忘錄10-12

    商務(wù)英語(yǔ)中的備忘錄怎么寫09-29

    解析工程機(jī)械液壓柱塞泵的使用與維修09-17

    鍋蓋使用技巧-如何使用鍋蓋10-29

    2017年小升初每月大事備忘錄07-28

    河北省建筑工程材料設(shè)備使用管理規(guī)定10-30

    孩子學(xué)小提琴的七個(gè)備忘錄10-27