關於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
每年到臘月間,越是接近年關,城裏人都忙着上街置辦過年物品,孝感鄉下卻都是自己動手準備年貨。寒冬臘月,雨雪紛飛的時候,農活不能幹,是鄉間辦年的好時機。家家戶戶醃魚肉,制陰米,磨湯圓,燙豆折,爆蠶豆,炒花生,嗵炒米,熬白糖……。而 -
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
NB: This may not be a word-for-word transcript. Emotional IntelligenceNow let’s take a look at some ways in which we can increase the levels of our own emotional intelligence so that employer