Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
22c26425
E
et
项目概览
guo450212436
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
22c26425
编写于
4月 18, 2018
作者:
T
tanghai
提交者:
GitHub
4月 18, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #57 from Viagi/master
完善NLog配置
上级
fa4634dd
25792bb9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
66 addition
and
12 deletion
+66
-12
Server/App/NLog.config
Server/App/NLog.config
+47
-9
Server/Model/Base/Log.cs
Server/Model/Base/Log.cs
+11
-1
Server/Model/Base/Logger/ILog.cs
Server/Model/Base/Logger/ILog.cs
+2
-1
Server/Model/Base/Logger/NLogAdapter.cs
Server/Model/Base/Logger/NLogAdapter.cs
+6
-1
未找到文件。
Server/App/NLog.config
浏览文件 @
22c26425
...
...
@@ -12,45 +12,83 @@
<
targets
>
<
target
name
=
"trace"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Trace.txt"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Trace/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
<
target
name
=
"trace"
type
=
"ColoredConsole"
<
target
name
=
"trace
Console
"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
</
targets
>
<
targets
>
<
target
name
=
"debug"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Debug.txt"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Debug/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}"
/>
<
target
name
=
"debug"
type
=
"ColoredConsole"
<
target
name
=
"debug
Console
"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}"
/>
</
targets
>
<
targets
>
<
target
name
=
"info"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Info.txt"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Info/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}"
/>
<
target
name
=
"info"
type
=
"ColoredConsole"
<
target
name
=
"info
Console
"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}"
/>
</
targets
>
<
targets
>
<
target
name
=
"error"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Error.txt"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Error/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
<
target
name
=
"error"
type
=
"ColoredConsole"
<
target
name
=
"errorConsole"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
</
targets
>
<
targets
>
<
target
name
=
"warn"
xsi
:
type
=
"File"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Warning/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
<
target
name
=
"warnConsole"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
</
targets
>
<
targets
>
<
target
name
=
"fatal"
xsi
:
type
=
"File"
openFileCacheTimeout
=
"3600"
ConcurrentWrites
=
"false"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}/Fatal/${shortdate}.log"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
<
target
name
=
"fatalConsole"
type
=
"ColoredConsole"
layout
=
"${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}"
/>
</
targets
>
<
rules
>
<
logger
name
=
"*"
minlevel
=
"Trace"
writeTo
=
"all"
/>
<
logger
name
=
"*"
minlevel
=
"Trace"
maxlevel
=
"Trace"
writeTo
=
"trace"
/>
<
logger
name
=
"*"
minlevel
=
"Trace"
maxlevel
=
"Trace"
writeTo
=
"traceConsole"
/>
<
logger
name
=
"*"
minlevel
=
"Debug"
maxlevel
=
"Debug"
writeTo
=
"debug"
/>
<
logger
name
=
"*"
minlevel
=
"Debug"
maxlevel
=
"Debug"
writeTo
=
"debugConsole"
/>
<
logger
name
=
"*"
minlevel
=
"Info"
maxlevel
=
"Info"
writeTo
=
"info"
/>
<
logger
name
=
"*"
minlevel
=
"Error"
writeTo
=
"error"
/>
<
logger
name
=
"*"
minlevel
=
"Info"
maxlevel
=
"Info"
writeTo
=
"infoConsole"
/>
<
logger
name
=
"*"
minlevel
=
"Warn"
maxlevel
=
"Warn"
writeTo
=
"warn"
/>
<
logger
name
=
"*"
minlevel
=
"Warn"
maxlevel
=
"Warn"
writeTo
=
"warnConsole"
/>
<
logger
name
=
"*"
minlevel
=
"Error"
maxlevel
=
"Error"
writeTo
=
"error"
/>
<
logger
name
=
"*"
minlevel
=
"Error"
maxlevel
=
"Error"
writeTo
=
"errorConsole"
/>
<
logger
name
=
"*"
minlevel
=
"Fatal"
maxlevel
=
"Fatal"
writeTo
=
"fatal"
/>
<
logger
name
=
"*"
minlevel
=
"Fatal"
maxlevel
=
"Fatal"
writeTo
=
"fatalConsole"
/>
</
rules
>
</
nlog
>
\ No newline at end of file
Server/Model/Base/Log.cs
浏览文件 @
22c26425
...
...
@@ -35,5 +35,15 @@ namespace ETModel
{
globalLog
.
Error
(
message
);
}
}
public
static
void
Fatal
(
Exception
e
)
{
globalLog
.
Fatal
(
e
.
ToString
());
}
public
static
void
Fatal
(
string
message
)
{
globalLog
.
Fatal
(
message
);
}
}
}
Server/Model/Base/Logger/ILog.cs
浏览文件 @
22c26425
...
...
@@ -7,5 +7,6 @@
void
Info
(
string
message
);
void
Debug
(
string
message
);
void
Error
(
string
message
);
}
void
Fatal
(
string
message
);
}
}
\ No newline at end of file
Server/Model/Base/Logger/NLogAdapter.cs
浏览文件 @
22c26425
...
...
@@ -34,5 +34,10 @@ namespace ETModel
{
this
.
logger
.
Error
(
this
.
Decorate
(
message
));
}
}
public
void
Fatal
(
string
message
)
{
this
.
logger
.
Fatal
(
this
.
Decorate
(
message
));
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录