add log prefix

This commit is contained in:
liang 2021-12-30 11:41:49 +08:00
parent b7ccd9317a
commit 220d9f17ca
2 changed files with 20 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<groupId>cn.axzo.framework</groupId>
<artifactId>common-common</artifactId>
<!-- release -->
<version>1.1.3</version>
<version>1.1.4</version>
<!-- snapshot -->
<!-- <version>1.0.0-SNAPSHOT</version>-->

View File

@ -0,0 +1,19 @@
package cn.azxo.framework.common.logger.logback;
import ch.qos.logback.core.PropertyDefinerBase;
public class LogPrefixPropertyDefiner extends PropertyDefinerBase {
@Override
public String getPropertyValue() {
PodNamespacePropertyDefiner podNamespacePropertyDefiner = new PodNamespacePropertyDefiner();
String env = podNamespacePropertyDefiner.getPropertyValue();
// 本地没有注入namespace
if (env == null) {
return "logs/";
} else {
return "/mnt/app-logdata/" + env;
}
}
}