How to connect SLF4J to Ignite

Let’s assume, that you already have configured SLF4J in your project. It remains to do two things.

Add dependency:

<dependency>
    <groupId>org.apache.ignite</groupId>
    <artifactId>ignite-slf4j</artifactId>
    <version>...</version>
</dependency>

Configure Ignite:

public IgniteConfiguration clientIgniteConfiguration(/*CommunicationSpi communicationSpi, */SslContextFactory sslContextFactory) {
    IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
    igniteConfiguration.setGridLogger(new Slf4jLogger());
    ...
    return igniteConfiguration;
}

If you still have any questions, feel free to ask me in the comments under this article, or write me on promark33@gmail.com.

Leave a Reply

Your email address will not be published.