关于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
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