- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章很实用的NLog配置分享由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
前言 。
NLog是一个基于.NET平台编写的类库,我们可以使用NLog在应用程序中添加极为完善的跟踪调试代码。本文主要介绍的是关于NLog配置的相关内容,下面话不多说了,来一起看看详细的介绍吧 。
NLog配置 。
新建一个文件命名为NLog.Config,然后添加如下代码 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
nlog
xmlns
=
"http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
targets
>
<
target
name
=
"asyncFile"
xsi:type
=
"AsyncWrapper"
>
<
target
name
=
"log_file"
xsi:type
=
"File"
fileName
=
"${basedir}/Logs/${shortdate}/${shortdate}.txt"
layout
=
"${longdate} | ${message} ${onexception:${exception:format=message} ${newline} ${stacktrace} ${newline}"
archiveFileName
=
"${basedir}/archives/${shortdate}-{#####}.txt"
archiveAboveSize
=
"102400"
archiveNumbering
=
"Sequence"
concurrentWrites
=
"true"
keepFileOpen
=
"false"
/>
</
target
>
<
target
name
=
"console"
xsi:type
=
"ColoredConsole"
layout
=
"[${date:format=HH\:mm\:ss}]:${message} ${exception:format=message}"
/>
</
targets
>
<
rules
>
<
logger
name
=
"*"
minlevel
=
"Error"
writeTo
=
"asyncFile"
/>
<
logger
name
=
"*"
minlevel
=
"Debug"
writeTo
=
"console"
/>
</
rules
>
</
nlog
>
|
第二种:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
nlog
xmlns
=
"http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
variable
name
=
"logLayout"
value
=
"Logger:${logger}${newline}Date:${longdate} Level:${uppercase:${level}}${newline}Message:${message} ${newline}${onexception:Exception:${exception:format=toString}${newline}}"
/>
<
targets
>
<
target
name
=
"asyncFile"
xsi:type
=
"AsyncWrapper"
>
<
target
name
=
"log_file"
xsi:type
=
"File"
fileName
=
"${basedir}/Logs/${shortdate}/${shortdate}.txt"
layout
=
"${logLayout}"
archiveFileName
=
"${basedir}/archives/${shortdate}-{#####}.txt"
archiveAboveSize
=
"102400"
archiveNumbering
=
"Sequence"
concurrentWrites
=
"false"
keepFileOpen
=
"true"
encoding
=
"utf-8"
openFileCacheTimeout
=
"30"
/>
</
target
>
</
targets
>
<
rules
>
<
logger
name
=
"*"
minlevel
=
"Info"
writeTo
=
"asyncFile"
/>
</
rules
>
</
nlog
>
|
总结 。
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对我的支持.
原文链接:https://www.cnblogs.com/stulzq/p/8504860.html 。
最后此篇关于很实用的NLog配置分享的文章就讲到这里了,如果你想了解更多关于很实用的NLog配置分享的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
直接上代码,可以写在公共文件common和继承的基础类中,方便调用 ?
1、php服务端环境搭建 1.php 服务端环境 安装套件 xampp(apach+mysql+php解释器) f:\mydoc文件(重要)\dl_学习\download重要资源\apache
如下所示: Eclipse快捷键 Ctrl+1 快速修复 Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加) Ctrl+Alt+↑ 复制当前行到上一行(复制增加)
第一步:conn.PHP文件,用于连接数据库并定义接口格式,代码如下: php" id="highlighter_808731">
本篇文章整理了几道Linux下C语言的经典面试题,相信对大家更好的理解Linux下的C语言会有很大的帮助,欢迎大家探讨指正。 1、如果在Linux下使用GCC编译器执行下列程序,输出结果是什么?
安装完最新的Boost库 官方说明中有一句话: Finally, $ ./b2 install will leave Boost binaries in the lib/ subdirecto
为了梳理前面学习的《spring整合mybatis(maven+mysql)一》与《spring整合mybatis(maven+mysql)二》中的内容,准备做一个完整的示例完成一个简单的图书管理功
网站内容质量仅仅是页面综合得分里面的一项.不管算法如何改变调整,搜索引擎都不会丢弃网站页面的综合得分。 一般情况下我们把页面的综合得分为8个点: 1、标题的设置 (标题的设置要有独特性)
最近事情很忙,一个新项目赶着出来,但是很多功能都要重新做,一直在编写代码、debug。今天因为一个新程序要使用fragment来做,虽然以前也使用过fragment,不过没有仔细研究,今天顺道写篇文
Android资源命名规范 最近几个月,大量涉及android资源的相关工作。对于复杂的应用而言,资源命名的规范很有必要。除了开发人员之外,UI设计人员(或者切图相关人员)也需要对资源使用的位置非常
以前一直使用Hibernate,基本上没用过Mybatis,工作中需要做映射关系,简单的了解下Mybatis的映射。 两者相差不多都支持一对一,一对多,多对多,本章简单介绍一对一的使用以及注意点。
如下所示: ? 1
如果想在自定义的View上面显示Button 等View组件需要完成如下任务 1.在自定义View的类中覆盖父类的构造(注意是2个参数的) 复制代码 代码如下: publ
实现功能:实现表格tr拖动,并保存因为拖动改变的等级. jsp代码 ?
代码:测试类 java" id="highlighter_819000"> ?
红黑树是一种二叉平衡查找树,每个结点上有一个存储位来表示结点的颜色,可以是red或black。 红黑树具有以下性质: (1) 每个结点是红色或是黑色 (2) 根结点是黑色的 (3) 如果一个
废话不多说,直接上代码 ? 1
码代码时,有时候需要根据比较大小分别赋值: ? 1
实际项目开发中,我们经常会用一些版本控制器来托管自己的代码,今天就来总结下Git的相关用法,废话不多说,直接开写。 目的:通过Git管理github托管项目代码 1、下载安装Git 1、下载
直接上代码: 复制代码 代码如下: //验证码类 class ValidateCode { private $charset = 'abcdefghkmnprstuvwxyzABC
我是一名优秀的程序员,十分优秀!