This commit is contained in:
gotoeasy
2024-09-09 11:26:43 +08:00
parent 0932f9a3cb
commit 1bea219b48
2 changed files with 9 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
<groupId>top.gotoeasy</groupId>
<artifactId>glc-logback-appender</artifactId>
<version>0.17.0</version>
<version>0.17.1</version>
<description>logback appender for glogcenter</description>
<repositories>

View File

@@ -139,6 +139,14 @@ public class GlcHttpJsonAppender extends AppenderBase<ILoggingEvent> {
if (apiUrl != null) {
apiUrl = apiUrl.trim();
if (!"".equals(apiUrl)) {
if (!apiUrl.endsWith("/glc/v1/log/add")) {
// 允许省略接口路径,默认自动补足以简化使用
if (apiUrl.endsWith("/")) {
apiUrl += "glc/v1/log/add";
} else {
apiUrl += "/glc/v1/log/add";
}
}
setGlcApiUrl(apiUrl);
}
}