fix client log config (#12040)
This commit is contained in:
parent
da3e88b3d4
commit
b016e79dfe
@ -108,6 +108,11 @@
|
|||||||
<AppenderRef ref="ASYNC_REMOTE"/>
|
<AppenderRef ref="ASYNC_REMOTE"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
|
|
||||||
|
<Logger name="com.alibaba.nacos.shaded.io.grpc" level="${nacosClientProperty:com.alibaba.nacos.config.log.level:-info}"
|
||||||
|
additivity="false">
|
||||||
|
<appender-ref ref="ASYNC-REMOTE"/>
|
||||||
|
</Logger>
|
||||||
|
|
||||||
<Logger name="com.alibaba.nacos.client.config" level="${nacosClientProperty:com.alibaba.nacos.config.log.level:-info}"
|
<Logger name="com.alibaba.nacos.client.config" level="${nacosClientProperty:com.alibaba.nacos.config.log.level:-info}"
|
||||||
additivity="false">
|
additivity="false">
|
||||||
<AppenderRef ref="ASYNC_CONFIG"/>
|
<AppenderRef ref="ASYNC_CONFIG"/>
|
||||||
|
@ -106,7 +106,7 @@ public class Log4J2NacosLoggingAdapterTest {
|
|||||||
loggerContext = (LoggerContext) LogManager.getContext(false);
|
loggerContext = (LoggerContext) LogManager.getContext(false);
|
||||||
contextConfiguration = loggerContext.getConfiguration();
|
contextConfiguration = loggerContext.getConfiguration();
|
||||||
Map<String, LoggerConfig> nacosClientLoggers = contextConfiguration.getLoggers();
|
Map<String, LoggerConfig> nacosClientLoggers = contextConfiguration.getLoggers();
|
||||||
assertEquals(5, nacosClientLoggers.size());
|
assertEquals(6, nacosClientLoggers.size());
|
||||||
for (Map.Entry<String, LoggerConfig> loggerEntry : nacosClientLoggers.entrySet()) {
|
for (Map.Entry<String, LoggerConfig> loggerEntry : nacosClientLoggers.entrySet()) {
|
||||||
String loggerName = loggerEntry.getKey();
|
String loggerName = loggerEntry.getKey();
|
||||||
Assert.assertTrue(loggerName.startsWith(NACOS_LOGGER_PREFIX));
|
Assert.assertTrue(loggerName.startsWith(NACOS_LOGGER_PREFIX));
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
<nacosClientProperty scope="context" name="logRetainCount" source="JM.LOG.RETAIN.COUNT" defaultValue="7"/>
|
<nacosClientProperty scope="context" name="logRetainCount" source="JM.LOG.RETAIN.COUNT" defaultValue="7"/>
|
||||||
<nacosClientProperty scope="context" name="logFileSize" source="JM.LOG.FILE.SIZE" defaultValue="10MB"/>
|
<nacosClientProperty scope="context" name="logFileSize" source="JM.LOG.FILE.SIZE" defaultValue="10MB"/>
|
||||||
<nacosClientProperty scope="context" name="nacosConfigLogLevel" source="com.alibaba.nacos.config.log.level" defaultValue="info"/>
|
<nacosClientProperty scope="context" name="nacosConfigLogLevel" source="com.alibaba.nacos.config.log.level" defaultValue="info"/>
|
||||||
|
<nacosClientProperty scope="context" name="nacosLogLevel" source="com.alibaba.nacos.log.level" defaultValue="info"/>
|
||||||
|
<nacosClientProperty scope="context" name="nacosNamingLogLevel" source="com.alibaba.nacos.naming.log.level" defaultValue="info"/>
|
||||||
|
|
||||||
|
|
||||||
<appender name="CONFIG_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="CONFIG_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
@ -99,12 +101,12 @@
|
|||||||
<appender-ref ref="ASYNC-CONFIG"/>
|
<appender-ref ref="ASYNC-CONFIG"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<Logger name="com.alibaba.nacos.common.labels" level="${nacosConfigLogLevel}"
|
<Logger name="com.alibaba.nacos.common.labels" level="${nacosLogLevel}"
|
||||||
additivity="false">
|
additivity="false">
|
||||||
<appender-ref ref="ASYNC-REMOTE"/>
|
<appender-ref ref="ASYNC-REMOTE"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
|
|
||||||
<Logger name="com.alibaba.nacos.common.remote.client" level="${nacosConfigLogLevel}"
|
<Logger name="com.alibaba.nacos.common.remote.client" level="${nacosLogLevel}"
|
||||||
additivity="false">
|
additivity="false">
|
||||||
<appender-ref ref="ASYNC-REMOTE"/>
|
<appender-ref ref="ASYNC-REMOTE"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
@ -119,7 +121,7 @@
|
|||||||
<appender-ref ref="ASYNC-CONFIG"/>
|
<appender-ref ref="ASYNC-CONFIG"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<logger name="com.alibaba.nacos.client.naming" level="${nacosConfigLogLevel}"
|
<logger name="com.alibaba.nacos.client.naming" level="${nacosNamingLogLevel}"
|
||||||
additivity="false">
|
additivity="false">
|
||||||
<appender-ref ref="ASYNC-NAMING"/>
|
<appender-ref ref="ASYNC-NAMING"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
Loading…
Reference in New Issue
Block a user