zoukankan      html  css  js  c++  java
  • Storm的log问题


    由于storm-core本身含有了 logback的相关依赖包,所以要排除掉

    <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-core</artifactId>
        <version>${storm-core-version}</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>logback-classic</artifactId>
                <groupId>ch.qos.logback</groupId>
            </exclusion>
            <exclusion>
                <artifactId>logback-core</artifactId>
                <groupId>ch.qos.logback</groupId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>log4j-over-slf4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    在自己的工程里引入下面的dependency,同时,需要src下面加入 log4j.properties

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

    下面是过程中遇到的几个错误,原文写的很详细。

    SLF4J的警告或错误信息
    SLF4J warning or error messages and their meanings
    http://www.slf4j.org/codes.html

    错误:Failed to load class org.slf4j.impl.StaticLoggerBinder

    解决方法:

    This warning message is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory.

    This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.

    错误:Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path

    解决方法:

    The purpose of slf4j-log4j12 module is to delegate or redirect calls made to an SLF4J logger to log4j.

    The purpose of the log4j-over-slf4j module is to redirect calls made to a log4j logger to SLF4J.

    If SLF4J is bound with slf4j-log4j12.jar and log4j-over-slf4j.jar is also present on the class path, a StackOverflowError will inevitably occur immediately after the first invocation of an SLF4J or a log4j logger.

  • 相关阅读:
    使用apt-mirror建立本地debian仓库源
    在MacOS上利用docker构建buildroot
    mac开发错误:errSecInternalComponent
    NFS作为根文件系统,挂载超时
    关于物体 '固有类别' 与 '实际使用类别' 分离的情况,结构体定义方法
    Crontab could not create directory .ssh
    mac bash_profile
    Mac bash rc
    watchtower无法自动更新镜像的解决方法
    spring security oAuth2.0 数据库说明
  • 原文地址:https://www.cnblogs.com/machong/p/5919063.html
Copyright © 2011-2022 走看看