【问题标题】:IBM RTC Logging SDK in Java with Spring Boot带有 Spring Boot 的 Java 中的 IBM RTC Logging SDK
【发布时间】:2016-03-17 20:31:05
【问题描述】:

当在应用程序中正常使用 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);

当尝试转换为 SpringBoot 时,我只添加了基本的 SpringBoot 包,并从 RTC SDK 获得了各种调试信息。即使我只将根记录器设置为 FATAL 并且没有在其他任何地方设置记录。

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

只要我添加了依赖项,(甚至没有 @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

我的问题是,我怎样才能关闭这种多余的注销?这很烦人,对我没用。

【问题讨论】:

  • 显然你必须在你的 pom 中的依赖标签下面包含这个:&lt;exclusions&gt; &lt;exclusion&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-logging&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;/exclusions&gt;

标签: java sdk spring-boot rtc


【解决方案1】:

正如我的同事在评论中建议的那样:

你必须在你的 pom 中的依赖标签下面包含这个:

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

【讨论】:

    猜你喜欢
    • 2018-06-24
    • 1970-01-01
    • 2017-02-26
    • 1970-01-01
    • 1970-01-01
    • 2021-03-13
    • 2021-03-16
    • 2022-12-03
    • 1970-01-01
    相关资源
    最近更新 更多