Commit e6fcb2d8 by Lizh

增加远程调用错误日志

parent a99c1ec0
......@@ -75,8 +75,8 @@ public class SaasAdminServiceImpl implements SaasAdminService {
if (!StringUtils.hasText(ids)) {
return Collections.emptyList();
}
try {
String url = adminBaseUrl + GET_PROPERTY_BY_IDS_URL + "?ids=" + ids;
try {
ResponseEntity<SaasAdminApiResponseModel<List<PropertyModel>>> response = remoteApiClient.get(
url,
new ParameterizedTypeReference<>() {},
......@@ -91,7 +91,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
log.warn("[ SaasAdminService ] getByIds 返回空, ids={}", ids);
return Collections.emptyList();
} catch (Exception e) {
log.error("[ SaasAdminService ] getByIds 调用失败, ids={}", ids, e);
log.error("[ SaasAdminService ] {} 调用失败, ids={}", url, ids, e);
return Collections.emptyList();
}
}
......@@ -109,9 +109,10 @@ public class SaasAdminServiceImpl implements SaasAdminService {
return entry.data;
}
// 未命中或已过期 → 远程调用刷新
String url = adminBaseUrl + GET_ALL_LIST_URL;
try {
ResponseEntity<SaasAdminApiResponseModel<List<CategoryInfoModel>>> response = remoteApiClient.get(
adminBaseUrl + GET_ALL_LIST_URL,
url,
new ParameterizedTypeReference<>() {},
getHeader());
if (response != null && response.getBody() != null) {
......@@ -123,7 +124,7 @@ public class SaasAdminServiceImpl implements SaasAdminService {
}
}
} catch (Exception e) {
log.error("[ SaasAdminService ] getAllList 调用失败", e);
log.error("[ SaasAdminService ] {} 调用失败", url, e);
}
// 远程调用失败但有旧缓存 → 降级返回旧缓存
if (entry != null) {
......
......@@ -4,17 +4,7 @@
<property name="max.file.size" value="50MB"/>
<property name="max.total.size" value="2GB"/>
<!-- ==================== 日志路径 ==================== -->
<!--
生效优先级(由 Spring Boot LoggingApplicationListener 处理):
1. application-dev.yml: logging.file.path: /var/log/app
2. JVM 启动参数: -DLOG_PATH=/var/log/app
3. 环境变量: export LOG_PATH=/var/log/app
4. 以上均未设置 → defaultValue: ./custom-v3/logs
LOG_PATH → logging.file.path 的映射由 Spring Boot 内置完成,
springProperty 从 Environment 中读取最终的 logging.file.path 值。
-->
<springProperty scope="context" name="log.path" source="logging.file.path" defaultValue="./custom-v3/logs"/>
<property name="log.path" value="./custom-v3/logs"/>
<!-- ==================== 日志格式 ==================== -->
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%X{traceId}] - [%method,%line] - %msg%n"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment