添加 Redis
parent
80389059ee
commit
8c3f4b78e5
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Debug",
|
||||||
|
"System": "Information",
|
||||||
|
"Microsoft": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
<?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"
|
||||||
|
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
||||||
|
autoReload="true"
|
||||||
|
keepVariablesOnReload="false"
|
||||||
|
throwExceptions="true"
|
||||||
|
throwConfigExceptions="true"
|
||||||
|
internalLogLevel="Trace"
|
||||||
|
internalLogFile="${basedir}\logs\internal-nlog.txt"
|
||||||
|
>
|
||||||
|
<!--引入Nlog扩展包-->
|
||||||
|
<extensions>
|
||||||
|
<add assembly="NLog.Web.AspNetCore"/>
|
||||||
|
<!--<add assembly="NLog.Redis"/>-->
|
||||||
|
<add assembly="NLog.Targets.Redis" />
|
||||||
|
</extensions>
|
||||||
|
|
||||||
|
<!--自定义变量-->
|
||||||
|
<variable name="myvariable" value="test" />
|
||||||
|
|
||||||
|
<!--设置目标-->
|
||||||
|
<targets>
|
||||||
|
<target xsi:type="Redis"
|
||||||
|
name="redis"
|
||||||
|
host="127.0.0.1"
|
||||||
|
port="6379"
|
||||||
|
db="0"
|
||||||
|
key="logKey"
|
||||||
|
dataType="list"
|
||||||
|
layout="${date:format=yyyyMMddHHmmss} ${uppercase:${level}} ${message}" />
|
||||||
|
</targets>
|
||||||
|
<rules>
|
||||||
|
<logger name="*" minlevel="Info" writeTo="redis" />
|
||||||
|
</rules>
|
||||||
|
</nlog>
|
Loading…
Reference in New Issue