记录插入API访问日志异常

This commit is contained in:
yangsb
2024-04-12 15:48:16 +08:00
parent b02c0bf481
commit 350614454e
2 changed files with 6 additions and 2 deletions
@@ -29,7 +29,11 @@ public class ApiAccessLogServiceImpl implements ApiAccessLogService {
@Override
public void createApiAccessLog(ApiAccessLogCreateReqDTO createDTO) {
ApiAccessLogDO apiAccessLog = BeanUtils.toBean(createDTO, ApiAccessLogDO.class);
try {
apiAccessLogMapper.insert(apiAccessLog);
}catch (Exception e) {
log.error("插入API 访问日志发生异常,异常信息{},日志内容{}", e.getMessage(), apiAccessLog);
}
}
@Override
@@ -38,7 +38,7 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService {
try {
apiErrorLogMapper.insert(apiErrorLog);
}catch (Exception e) {
log.error("插入系统异常日志发生异常,日志内容{}", apiErrorLog);
log.error("插入系统异常日志发生异常,异常信息{}日志内容{}",e.getMessage(), apiErrorLog);
}
}