u011407398
忧心悄悄
2017-10-31 03:09

使用dubbo的项目处理多种日志依赖? log4j, logback混用

3
  • maven
  • dubbo
  • log4j

使用dubbo的项目中配置如下依赖和log4j.properties

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
    </dependency>

java wrapper service启动时,如果项目本身出现异常,wrapper.log中报缺少logback依赖
添加logback依赖后

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
    </dependency>

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
    </dependency>

wrapper.log中不断打印debug日志(关于zookeeper的)

求解决办法

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答