Ignite - Logging - Using Logback and setting logging level

classic Classic list List threaded Threaded
3 messages Options
M Singh M Singh
Reply | Threaded
Open this post in threaded view
|

Ignite - Logging - Using Logback and setting logging level

Hi Folks:

I wanted to find if Ignite can use logback for logging and if so, what are the steps to do so.

Thanks


djm132 djm132
Reply | Threaded
Open this post in threaded view
|

Re: Ignite - Logging - Using Logback and setting logging level

I am using logback with ignite.

You need to add the following to pom.xml

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

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

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>1.7.21</version>
        </dependency>

Before starting ignite node add these lines

        // Redirect JUL logging to slf4j
        SLF4JBridgeHandler.removeHandlersForRootLogger();
        SLF4JBridgeHandler.install();

Configure logback as usual.

Hope this helps.
djm132 djm132
Reply | Threaded
Open this post in threaded view
|

Re: Ignite - Logging - Using Logback and setting logging level

In reply to this post by M Singh
Actually, you even don't need these two lines and jul-to-slf4j library. Ignite will work well with rest.