關於Log4net工程使用備忘
為了方便廣大計算機愛好者,下面是小編整理的關於Log4net工程中的使用備忘,歡迎參考!
(1):引用log4net
(2):using log4net;
(3):建構函式中
static CoreLogging()
{
igure();
}
(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 = ogger(GeneralCategory);
private static ILog scriptLog = ogger(ScriptCategory);
private static ILog configLog = ogger(ConfigCategory);
private static ILog scanLog = ogger(ScanCategory);
private static ILog messageMergeLog = ogger(MessageMergeCategory);
private static ILog udpLog = ogger(UdpCategory);
private static ILog alarmLog = ogger(AlarmCategory);
private static ILog unknownDeviceLog = ogger(UnknownDeviceCategory);
private static void Log(ILog logger, Object message, Priority priority)
{
switch (priority)
{
case G:
g(message);
break;
case :
(message);
break;
case :
(message);
break;
case R:
r(message);
break;
case L:
l(message);
break;
}
}
public static void LogMessageMergeLog(object message, Priority priority)
{
Log(messageMergeLog, message, priority);
}
///
/// 通過Udp傳送日誌
///
/// 要傳送的.訊息內容
/// 優先順序
public static void SendLogViaUdp(object message, Priority priority)
{
Log(udpLog, message, priority);
}
其他的略。
配置檔案中需要配置如下
其他略
下面為各個動作。Trace型別
相關文章
-
在用硬碟無損4K對齊Paragon Alignment Tool中文使用教程
Paragon 對齊工具是可同時用於物理和虛擬系統的軟體工具。它可用於檢測並解決4K 大小物理扇區高階格式化驅動(AF 驅動)、穩定狀態驅動(SSD)以及獨立磁碟冗餘陣列(RAID)中的對齊問題。使用PAT進行檢測並重新對齊扇區能夠確保 -
職稱計算機考試Internet基礎知識:Google使用方法
導語:Google是世界上最大的搜尋引擎,索引了數十億網頁。利用Google可以進行文字、圖片、視訊、地圖、音樂等專案的搜尋,對外文網頁還能自動翻譯。第一次進入Google,它會根據使用者使用的作業系統,確定語言介面。需要提醒的是 -
關於智慧的英語段落:The dull edge of intelligence
Whether AI will ever truly replace the woolly methods of fashion forecasting remains to be seen. Some worry that using AI may dull design. The business has already become pedantic and a matter of perc -
高一英語寫作範文:Is It the Only Way Out To Go To College
Is It the Only Way Out To Go To College ?We had a discussion about whether it is the only way out for senior students to go to college.Views vary from person to majority of us consider it very necessa -
Module 4 Unit1 We’re going to tell stories.教學設計
一、教材分析本模組的話題是發出慶祝生日活動的邀請。本單元的課文情境是Amy發給Lingling的生日邀請函,她要過11歲的生日了。Lingling問Amy打算如何慶祝,Amy說要和大家一起吃午餐,媽媽會給她做蛋糕。Sam說午餐後大家 -
php使用file-get-contents讀取大檔案的方法
本文介紹了在php中使用file_get_contents函式讀取大檔案的方法,並附上了示例以及使用小技巧,非常的實用,這裡推薦給大家,就跟隨本站小編一起去了解下吧,想了解更多相關資訊請持續關注我們應屆畢業生考試網!當我們遇到文字 -
College Students’ Job Hunting大學生找工作英語作文
College Students’ Job HuntingIn recent years, college students find it increasingly difficult to get a job. It sounds strange since young college students are usually intelligent, well-educated and e -
榮耀屬於你們The Glory Belongs to You高中英語作文
During the Olympic Games, the first goden medal caught people’s attention all the time, so many players who were put great hope to get the godel medal burdened so much pressure. When the players win -
如何使用Google-Code-Prettify 實現程式碼高亮功能
導語:如何使用Google-Code-Prettify 實現程式碼高亮功能,為了方便大家的練習,下面是小編給大家提供的使用方法,大家可以參考閱讀,更多詳情請關注應屆畢業生考試網。 的'使用方法: 1.引入 jQuery 檔案和 檔案<script -
2016商務英語寫作範文:Emotional Intelligence
在平凡的學習、工作、生活中,大家都不可避免地要接觸到作文吧,作文根據寫作時限的不同可以分為限時作文和非限時作文。你所見過的作文是什麼樣的呢?以下是小編收集整理的龜兔賽跑童話作文,歡迎大家分享。龜兔賽跑童話作文