Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
ea7e1177
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,发现更多精彩内容 >>
提交
ea7e1177
编写于
9月 19, 2017
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.终于找到log 文件行号显示不准的问题了,原来是用了Release
2.格式化一下log,更好看一点
上级
8d33d1e7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
10 deletion
+9
-10
Server/App/NLog.config
Server/App/NLog.config
+4
-4
Server/App/Program.cs
Server/App/Program.cs
+2
-0
Server/Model/Component/StartConfigComponent.cs
Server/Model/Component/StartConfigComponent.cs
+3
-6
未找到文件。
Server/App/NLog.config
浏览文件 @
ea7e1177
...
@@ -7,28 +7,28 @@
...
@@ -7,28 +7,28 @@
<
target
name
=
"all"
xsi
:
type
=
"File"
<
target
name
=
"all"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log.txt"
fileName
=
"${basedir}/../Logs/Log.txt"
deleteOldFileOnStartup
=
"false"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appType
} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=1
} ${message}"
/>
layout
=
"${longdate} ${var:appType
Format} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2
} ${message}"
/>
</
targets
>
</
targets
>
<
targets
>
<
targets
>
<
target
name
=
"debug"
xsi
:
type
=
"File"
<
target
name
=
"debug"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Debug.txt"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Debug.txt"
deleteOldFileOnStartup
=
"false"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appType
} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=1
} ${message} ${stacktrace:format=Flat:topFrames=100:skipFrames=0}"
/>
layout
=
"${longdate} ${var:appType
Format} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2
} ${message} ${stacktrace:format=Flat:topFrames=100:skipFrames=0}"
/>
</
targets
>
</
targets
>
<
targets
>
<
targets
>
<
target
name
=
"info"
xsi
:
type
=
"File"
<
target
name
=
"info"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Info.txt"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Info.txt"
deleteOldFileOnStartup
=
"false"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appType
} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=1
} ${message}"
/>
layout
=
"${longdate} ${var:appType
Format} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2
} ${message}"
/>
</
targets
>
</
targets
>
<
targets
>
<
targets
>
<
target
name
=
"error"
xsi
:
type
=
"File"
<
target
name
=
"error"
xsi
:
type
=
"File"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Error.txt"
fileName
=
"${basedir}/../Logs/Log-${var:appType}-${var:appId}-Error.txt"
deleteOldFileOnStartup
=
"false"
deleteOldFileOnStartup
=
"false"
layout
=
"${longdate} ${var:appType
} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=1
} ${message} ${stacktrace:format=Flat:topFrames=100:skipFrames=0}"
/>
layout
=
"${longdate} ${var:appType
Format} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2
} ${message} ${stacktrace:format=Flat:topFrames=100:skipFrames=0}"
/>
</
targets
>
</
targets
>
<
rules
>
<
rules
>
...
...
Server/App/Program.cs
浏览文件 @
ea7e1177
...
@@ -31,6 +31,8 @@ namespace App
...
@@ -31,6 +31,8 @@ namespace App
LogManager
.
Configuration
.
Variables
[
"appType"
]
=
startConfig
.
AppType
.
ToString
();
LogManager
.
Configuration
.
Variables
[
"appType"
]
=
startConfig
.
AppType
.
ToString
();
LogManager
.
Configuration
.
Variables
[
"appId"
]
=
startConfig
.
AppId
.
ToString
();
LogManager
.
Configuration
.
Variables
[
"appId"
]
=
startConfig
.
AppId
.
ToString
();
LogManager
.
Configuration
.
Variables
[
"appTypeFormat"
]
=
$"
{
startConfig
.
AppType
,-
8
}
"
;
LogManager
.
Configuration
.
Variables
[
"appIdFormat"
]
=
$"
{
startConfig
.
AppId
:
D3
}
"
;
Log
.
Info
(
"server start........................"
);
Log
.
Info
(
"server start........................"
);
...
...
Server/Model/Component/StartConfigComponent.cs
浏览文件 @
ea7e1177
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
namespace
Model
namespace
Model
{
{
...
@@ -15,8 +16,6 @@ namespace Model
...
@@ -15,8 +16,6 @@ namespace Model
public
class
StartConfigComponent
:
Component
public
class
StartConfigComponent
:
Component
{
{
private
List
<
StartConfig
>
allConfigs
;
private
Dictionary
<
int
,
StartConfig
>
configDict
;
private
Dictionary
<
int
,
StartConfig
>
configDict
;
public
StartConfig
StartConfig
{
get
;
private
set
;
}
public
StartConfig
StartConfig
{
get
;
private
set
;
}
...
@@ -33,7 +32,6 @@ namespace Model
...
@@ -33,7 +32,6 @@ namespace Model
public
void
Awake
(
string
path
,
int
appId
)
public
void
Awake
(
string
path
,
int
appId
)
{
{
this
.
allConfigs
=
new
List
<
StartConfig
>();
this
.
configDict
=
new
Dictionary
<
int
,
StartConfig
>();
this
.
configDict
=
new
Dictionary
<
int
,
StartConfig
>();
this
.
MapConfigs
=
new
List
<
StartConfig
>();
this
.
MapConfigs
=
new
List
<
StartConfig
>();
this
.
GateConfigs
=
new
List
<
StartConfig
>();
this
.
GateConfigs
=
new
List
<
StartConfig
>();
...
@@ -49,7 +47,6 @@ namespace Model
...
@@ -49,7 +47,6 @@ namespace Model
try
try
{
{
StartConfig
startConfig
=
MongoHelper
.
FromJson
<
StartConfig
>(
s2
);
StartConfig
startConfig
=
MongoHelper
.
FromJson
<
StartConfig
>(
s2
);
this
.
allConfigs
.
Add
(
startConfig
);
this
.
configDict
.
Add
(
startConfig
.
AppId
,
startConfig
);
this
.
configDict
.
Add
(
startConfig
.
AppId
,
startConfig
);
if
(
startConfig
.
AppType
.
Is
(
AppType
.
Realm
))
if
(
startConfig
.
AppType
.
Is
(
AppType
.
Realm
))
...
@@ -100,14 +97,14 @@ namespace Model
...
@@ -100,14 +97,14 @@ namespace Model
public
StartConfig
[]
GetAll
()
public
StartConfig
[]
GetAll
()
{
{
return
this
.
allConfig
s
.
ToArray
();
return
this
.
configDict
.
Value
s
.
ToArray
();
}
}
public
int
Count
public
int
Count
{
{
get
get
{
{
return
this
.
allConfigs
.
Count
;
return
this
.
configDict
.
Count
;
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录