简体   繁体   English

带有Spring Boot的Java中的IBM RTC Logging SDK

[英]IBM RTC Logging SDK in Java with Spring Boot

When using the RTC SDK normally in an application, I can turn off the logging in that layer using Log4j with the following code: 在应用程序中正常使用RTC SDK时,我可以使用Log4j使用以下代码关闭该层中的日志记录:

// Only show warnings for IBM dependencies
Logger.getLogger("com.ibm").setLevel(Level.WARN);
Logger.getLogger("com.ibm").setAdditivity(false);
Logger.getRootLogger().setLevel(Level.DEBUG);

When trying to convert over to SpringBoot, I add just the basic SpringBoot package and I get all sorts of debug information from the RTC SDK. 在尝试转换为SpringBoot时,我只添加了基本的SpringBoot包,并从RTC SDK中获取了各种调试信息。 Even if I have only the root logger set to FATAL and have not settings anywhere else for logging. 即使我仅将根记录器设置为FATAL,而没有其他地方进行记录。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <version>1.3.2.RELEASE</version>
</dependency>

As soon as I add the dependency, (without even having the @SpringBootApplication annotation or even SpringApplication.run(Main.class, args), it starts spewing out RTC log information like the following: 一旦我添加了依赖项,(甚至没有@SpringBootApplication批注,甚至没有SpringApplication.run(Main.class,args)),它就会开始喷出RTC日志信息,如下所示:

16:14:20.161 [main] DEBUG c.i.t.r.c.i.u.InternalTeamPlatform - Thread[main,5,main]
16:14:20.164 [main] DEBUG c.i.t.r.c.i.u.InternalTeamPlatform - start asBundlefalse
16:14:20.164 [main] DEBUG c.i.t.r.c.i.u.InternalTeamPlatform - set start true
16:14:22.387 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Entering setCredentials(userid=, password=)
16:14:22.387 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Entering closeHttpClient
16:14:22.387 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Value of _httpclient: null
16:14:22.408 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - httpclient already closed
16:14:22.410 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Entering createTeamService
16:14:22.410 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - creating RemoteTeamService from com.ibm.team.repository.common.internal.IRepositoryRemoteService
16:14:22.420 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Entering createTeamService
16:14:22.420 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - creating RemoteTeamService from com.ibm.team.repository.common.service.IQueryService
16:14:22.424 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - Entering createTeamService
16:14:22.424 [main] DEBUG c.i.t.r.t.client.RemoteTeamServer - creating RemoteTeamService from com.ibm.team.repository.common.service.IExternalUserRegistryService

My question is, how can I turn this excess logging off? 我的问题是,如何关闭多余的日志? It is quite annoying and not useful to me. 这很烦人,对我没用。

As my colleague suggested in his comment: 正如我的同事在评论中建议的那样:

you have to include this inside of your pom underneath the dependency tag: 你必须在你的pom里面包含这个依赖标记:

<exclusions>
    <exclusion>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-logging</artifactId>
    </exclusion>
</exclusions>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM