aofall opened a new issue, #12650: URL: https://github.com/apache/dubbo/issues/12650
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: 3.1.9 * Operating System version: Windows * Java version: 11.0.18 ### Steps to reproduce this issue 1. 正常启动一个普通springboot+dubbo应用,使用默认的logback且未配置日志选项 2. 使用 QoS 命令 `loggerInfo` 查询日志配置 3. 未正确返回结果,且应用控制台抛出NPE ```bash telnet localhost 22222 ___ __ __ ___ ___ ____ / _ \ / / / // _ ) / _ ) / __ \ / // // /_/ // _ |/ _ |/ /_/ / /____/ \____//____//____/ \____/ dubbo>loggerInfo loggerInfo :fail to execute commandContext by null ``` ### Expected Behavior <!-- What do you expect from the above steps?--> 正常查询应用的日志配置 ,如果某些参数未配置则提供默认值(如 Log level: INFO) ### Actual Behavior <!-- What actually happens? --> If there is an exception, please attach the exception trace: ``` 14:15:36.417 logback [qos-worker-3-1] INFO o.a.d.q.c.DefaultCommandExecutor - [DUBBO] [Dubbo QoS] Command Process start. Command: loggerInfo, Args: [], Remote Address: /0:0:0:0:0:0:0:1:63671, dubbo version: 3.1.9, current host: 10.201.50.35 No such logging.properties in classpath for jdk logging config! 14:15:36.450 logback [qos-worker-3-1] INFO o.a.d.q.c.DefaultCommandExecutor - [DUBBO] [Dubbo QoS] Command Process Failed. Command: loggerInfo, Args: [], Remote Address: /0:0:0:0:0:0:0:1:63671, dubbo version: 3.1.9, current host: 10.201.50.35 java.lang.NullPointerException: null at org.apache.dubbo.qos.command.impl.LoggerInfo.execute(LoggerInfo.java:35) at org.apache.dubbo.qos.command.DefaultCommandExecutor.execute(DefaultCommandExecutor.java:57) at org.apache.dubbo.qos.server.handler.TelnetProcessHandler.channelRead0(TelnetProcessHandler.java:59) at org.apache.dubbo.qos.server.handler.TelnetProcessHandler.channelRead0(TelnetProcessHandler.java:40) 14:15:36.451 logback [qos-worker-3-1] ERROR o.a.d.q.s.h.TelnetProcessHandler - [DUBBO] execute commandContext got exception org.apache.dubbo.qos.command.CommandContext@740b26f8, dubbo version: 3.1.9, current host: 10.201.50.35, error code: 7-6. This may be caused by , go to https://dubbo.apache.org/faq/7/6 to find instructions. java.lang.NullPointerException: null at org.apache.dubbo.qos.command.impl.LoggerInfo.execute(LoggerInfo.java:35) at org.apache.dubbo.qos.command.DefaultCommandExecutor.execute(DefaultCommandExecutor.java:57) at org.apache.dubbo.qos.server.handler.TelnetProcessHandler.channelRead0(TelnetProcessHandler.java:59) at org.apache.dubbo.qos.server.handler.TelnetProcessHandler.channelRead0(TelnetProcessHandler.java:40) ``` 断点调试发现 `org.apache.dubbo.qos.command.impl.LoggerInfo` 33行中返回了 null  使用 `switchLogLevel` 修改日志级别后再使用 `loggerInfo` 查询则正常 ``` dubbo>loggerInfo loggerInfo :fail to execute commandContext by null dubbo>switchLogLevel INFO OK dubbo>loggerInfo Available logger adapters: [slf4j, jcl, log4j2, jdk]. Current Adapter: [slf4j]. Log level: INFO ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
