Search code examples
loggingignite

Why does ignite-rest-http disable my logging?


I have ignite-core working nicely with my application's log by including the ignite-slf4j module and calling config.setGridLogger(new Slf4jLogger). However, when I include the ignite-rest-http module, all of my log output disappears. How do I get it back, and include any logging from ignite-rest-http?


Solution

  • It happens because ignite-rest-http module has slf4j-log4j12 as a dependency for some reason.

    To make logging over slf4j work with Rest API enabled I had to exclude slf4j-log4j12 and log4j dependencies from classpath.

    For example, in Maven it is achieved by editing the dependency entry:

    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-rest-http</artifactId>
        <version>2.3.0</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>