fix记录日志字符串过长问题
This commit is contained in:
parent
ac277c9230
commit
4bbaa9d029
@ -93,6 +93,7 @@ namespace ZR.Admin.WebApi.Middleware
|
||||
operLocation = ip_info.Province + " " + ip_info.City,
|
||||
operTime = DateTime.Now
|
||||
};
|
||||
HttpContextExtension.GetRequestValue(context, sysOperLog);
|
||||
var endpoint = GetEndpoint(context);
|
||||
if (endpoint != null)
|
||||
{
|
||||
@ -105,7 +106,6 @@ namespace ZR.Admin.WebApi.Middleware
|
||||
sysOperLog.jsonResult = logAttribute.IsSaveResponseData ? sysOperLog.jsonResult : "";
|
||||
}
|
||||
}
|
||||
HttpContextExtension.GetRequestValue(context, sysOperLog);
|
||||
LogEventInfo ei = new(logLevel, "GlobalExceptionMiddleware", error);
|
||||
|
||||
ei.Exception = ex;
|
||||
|
||||
@ -27,6 +27,10 @@ namespace ZR.Service.System
|
||||
/// <param name="operLog">日志对象</param>
|
||||
public void InsertOperlog(SysOperLog operLog)
|
||||
{
|
||||
if (operLog.operParam.Length >= 1000)
|
||||
{
|
||||
operLog.operParam = operLog.operParam.Substring(0, 1000);
|
||||
}
|
||||
sysOperLogRepository.AddSysOperLog(operLog);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user