提交 582ae40c 编写于 作者: G Gao Hongtao

Add null value to config table

Signed-off-by: NGao Hongtao <hanahmily@gmail.com>
上级 dde9a788
......@@ -19,7 +19,6 @@
package org.apache.skywalking.oap.server.configuration.configmap;
import io.kubernetes.client.openapi.models.V1ConfigMap;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import lombok.extern.slf4j.Slf4j;
......@@ -46,9 +45,7 @@ public class ConfigmapConfigurationWatcherRegister extends ConfigWatcherRegister
if (log.isDebugEnabled()) {
log.debug("read config: name:{} ,value:{}", name, value);
}
if (Objects.nonNull(value)) {
configTable.add(new ConfigTable.ConfigItem(name, value));
}
configTable.add(new ConfigTable.ConfigItem(name, value));
}
return Optional.of(configTable);
}
......
......@@ -31,8 +31,8 @@ import org.apache.skywalking.oap.server.core.logging.log4j.OapConfiguration;
import org.apache.skywalking.oap.server.library.module.ModuleProvider;
/**
* LoggingConfigWatcher watches the change of logging configuration.
* Once got the change content, it would apply them to the current logger context.
* LoggingConfigWatcher watches the change of logging configuration. Once got the change content, it would apply them to
* the current logger context.
*/
@Slf4j
public class LoggingConfigWatcher extends ConfigChangeWatcher {
......@@ -65,8 +65,10 @@ public class LoggingConfigWatcher extends ConfigChangeWatcher {
}
StringBuilder builder = new StringBuilder();
ctx.getConfiguration().getLoggers().forEach((loggerName, config) -> {
builder.append(loggerName).append("-").append(config.getName()).append(":")
.append(config.getLevel()).append(",");
builder.append(Strings.isNullOrEmpty(loggerName) ? "Root" : loggerName)
.append(":")
.append(config.getLevel())
.append(",");
});
this.content = builder.toString();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册