配置文件

master
zhangxiaofeng 6 months ago
parent ccefa272f3
commit d157e00049

@ -265,5 +265,16 @@ namespace EntrustSettle.Api.Controllers
return SuccessMsg(msg);
}
}
[HttpGet]
public string TestTime()
{
return DateTime.Now.ToString();
}
[HttpGet]
public void TestError()
{
throw new Exception("测试异常");
}
}
}

@ -4,10 +4,10 @@
autoReload="true"
throwExceptions="false"
internalLogLevel="off" internalLogFile="${basedir}/Logs/nlog-internal.log">
<variable name="MicrosoftLevel" value="${level:lowercase=true:truncate=4:when=level==LogLevel.Info or level==LogLevel.Warn}${when:when=level==LogLevel.Error:inner=fail}${when:when=level==LogLevel.Fatal:inner=crit}${when:when=level==LogLevel.Debug:inner=dbug}${when:when=level==LogLevel.Trace:inner=trce}" />
<variable name="MicrosoftLayout" value="${MicrosoftLevel}: ${logger}[${event-properties:EventId_Id:whenEmpty=0}]${newline} ${message}${onexception:inner=${newline}${exception:format=tostring}}" />
<targets>
<!--archiveAboveSize="10240000"表示单个文件最大10M-->
<!--maxArchiveFiles="30"表示同一文件夹下最多留存30个日志文件超出将删除-->
@ -21,21 +21,21 @@
</target>
<target name="all" xsi:type="File" maxArchiveFiles="30" archiveAboveSize="10240000"
fileName="${basedir}/Logs/${shortdate}/all.log"
fileName="${basedir}/Logs/${shortdate}/All.log"
layout="${longdate} | ${level} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}" />
<target name="error" xsi:type="File" maxArchiveFiles="30" archiveAboveSize="10240000"
fileName="${basedir}/Logs/${shortdate}/error.log"
fileName="${basedir}/Logs/${shortdate}/Error.log"
layout="${longdate} | ${level} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}" />
<target name="big" xsi:type="AsyncWrapper">
<target xsi:type="File" maxArchiveFiles="30" archiveAboveSize="10240000"
fileName="${basedir}/Logs/${shortdate}/big.log"
fileName="${basedir}/Logs/${shortdate}/Big.log"
layout="${longdate} | ${level} | ${message}" />
</target>
<target name="info" xsi:type="File" maxArchiveFiles="30" archiveAboveSize="10240000"
fileName="${basedir}/Logs/${shortdate}/info.log"
fileName="${basedir}/Logs/${shortdate}/Info.log"
layout="${longdate} | ${level} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}" />
<target name="database" xsi:type="Database"

@ -0,0 +1,256 @@
{
"urls": "http://*:6101", //webIIS
"AllowedHosts": "*",
"Startup": {
"Domain": "http://118.190.144.189:6101",
"WorkerId": 13,
"Cors": {
"PolicyName": "CorsIpAccess", //
"EnableAllIPs": true, //trueIP访
// /localhost:8000/http://127.0.0.1:1818 http://localhost:1818
"IPs": "http://127.0.0.1:2364,http://localhost:2364,http://127.0.0.1:6688,http://localhost:6688"
},
"AppConfigAlert": {
"Enabled": true
},
"ApiName": "EntrustSettle",
"IdentityServer4": {
"Enabled": true, // false使jwttrue使Ids4
"AuthorizationUrl": "http://djy-identity.myshipping.net", //
"ApiName": "(未验证Audience)" //
},
"RedisMq": {
"Enabled": false //redis
},
"UserInfoCacheTime": 60 //
},
"Apis": {
"Hyd": {
"BaseUrl": "http://apiplat.sdland-sea.com",
"LoginUrl": "/hydCd/login?key=9700547634344b8b97f0bd0f38966801",
"QueryUrl": "无",
"SubmitUrl": "/hyd/saveWholeForOther?key=b2cb260839c24cac9b13d3dbcf8493ee",
"FeedbackUrl": "/hyd/sendFeedback?key=b2cb260839c24cac9b13d3dbcf8493ee",
"username": "15653213875",
"password": "BLE8HHOFCPU8I5qgLB+FjdOj/gX32D8sHsAHk/tN0cgFhx0XfixoDrvNmhjhi9XSs+V6suodyIYSiRwACya1IA==",
"CUSTOMER": "687489"
}
},
// JwtIdentityServer4
"Audience": {
"Secret": "sdfsdfsrty45634kkhllghtdgdfss345t678fs", //16+
"SecretFile": "C:\\my-file\\entrust.settle.audience.secret.txt", //Secret
"Issuer": "EntrustSettle",
"Audience": "wr"
},
"Middleware": {
"RequestResponseLog": {
"Enabled": true,
"IgnoreRequestApis": "/api/Annex/Upload,/api/Open/AnnexUpload",
"IgnoreResponseApis": "/api/Annex/DownloadFile,/api/Annex/Download,/api/Open/AnnexDownload",
"LogToFile": {
"Enabled": true
},
"LogToDB": {
"Enabled": false
}
},
"RecordAccessLogs": {
"Enabled": true,
"LogToFile": {
"Enabled": true
},
"LogToDB": {
"Enabled": false
},
"IgnoreApis": "/api/Annex/Upload,/api/Open/AnnexUpload,/api/Annex/DownloadFile,/api/Annex/Download,/api/Open/AnnexDownload"
},
"SignalR": {
"Enabled": false
},
"SignalRSendLog": {
"Enabled": false
},
"IpRateLimit": {
"Enabled": false
},
"EncryptionResponse": {
"Enabled": false,
"AllApis": false,
"LimitApis": [
"/api/Login/GetJwtTokenSecret"
]
},
"EncryptionRequest": {
"Enabled": false,
"AllApis": false,
"LimitApis": [
"/api/Login/GetJwtTokenSecret"
]
}
},
"AppSettings": {
// Sql
"LogToDb": false,
// AOP
"ServiceAOPLog": {
"Enabled": false,
"LogToFile": {
"Enabled": true
},
"LogToDB": {
"Enabled": false
}
},
// Sql
"SqlAOPLog": {
"Enabled": true,
"LogToFile": {
"Enabled": true
},
"LogToConsole": {
"Enabled": false
},
"LogToDB": {
"Enabled": false
}
},
//
"CachingAOP": {
"Enabled": true
},
//
"TranAOP": {
"Enabled": true
},
"SeedDBEnabled": false, //
"RoutePrefix": "" //
},
// DBType0=MySql,1=SqlServer,2=Sqlite,3=Oracle,4=PostgreSQL,5=Dm,6=Kdbndp
//
// MainDbEnabledtrue
// Slaves
// LogEnabledtrue
//
//
// ConnIdConnId
// ConnIdMainConnIdMain1
//
"MainDB": "Main",
"DBS": [
{
"ConnId": "Main",
"DBType": 0,
"Enabled": true,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;Database=entrustsettle;Uid=rulesengine_admin;Pwd=Rule1qaz2wsx!QAZ;Port=3306;Allow User Variables=True;Charset=utf8;TreatTinyAsBoolean=false;",
"Slaves": [
{
"HitRate": 0, // 0使
"Connection": "server=localhost;Database=(unused);Uid=root;Pwd=qwer1234;Port=3306;Allow User Variables=True;Charset=utf8;TreatTinyAsBoolean=false;"
}
]
},
{
"ConnId": "Main2",
"DBType": 2,
"Enabled": false,
"Connection": "(unused).db",
"Slaves": [
{
"HitRate": 0, // 0使
"Connection": "(unused).db"
}
]
},
{
"ConnId": "Log", //
"DBType": 0,
"Enabled": true,
"HitRate": 50,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;Database=entrustsettle_log;Uid=rulesengine_admin;Pwd=Rule1qaz2wsx!QAZ;Port=3306;Allow User Variables=True;"
},
{
"ConnId": "PingTai",
"DBType": 1,
"Enabled": true,
"Connection": "Server=172.31.85.154,1433;Database=DsPingTai;User=sa;Password=QDdjy#2020*;MultipleActiveResultSets=True;"
}
],
"Mongo": {
"ConnectionString": "mongodb://nosql.data",
"Database": "BlogCoreDb"
},
"IpRateLimiting": {
"EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"IpWhitelist": [], //
"EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ],
"ClientWhitelist": [ "dev-client-1", "dev-client-2" ],
"QuotaExceededResponse": {
"Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}",
"ContentType": "application/json",
"StatusCode": 429
},
"HttpStatusCode": 429, //
"GeneralRules": [ //api,*
{
"Endpoint": "*:/api/entrust*",
"Period": "1m",
"Limit": 20
},
{
"Endpoint": "*/api/*",
"Period": "1s",
"Limit": 3
},
{
"Endpoint": "*/api/*",
"Period": "1m",
"Limit": 30
},
{
"Endpoint": "*/api/*",
"Period": "12h",
"Limit": 500
}
]
},
// Quartz
"QuartzNetJob": {
"Enabled": true
},
//
"TimedJob": {
"Enabled": false
},
"Redis": {
"Enabled": true,
"ConnectionString": "127.0.0.1:6379,defaultDatabase=4",
"InstanceName": "" //Key
},
"RabbitMQ": {
"Enabled": true,
"ConnectionString": "amqp://entrust_settle_user:entrust_settle^2024@47.104.207.5:12567/entrust_settle"
//"Connection": "60.209.125.238:40101/audit_booking",
//"UserName": "audit_booking_user",
//"Password": "djy^2024",
//"RetryCount": 3
},
"Kafka": {
"Enabled": false,
"Servers": "localhost:9092",
"Topic": "entrustsettle",
"GroupId": "entrustsettle-consumer",
"NumPartitions": 3 //
},
"EventBus": {
"Enabled": false,
"SubscriptionClientName": "EntrustSettle"
}
}
Loading…
Cancel
Save