Hello,

I'm new to Ignite and am trying to setup log4j logging for an Ignite node.

I'm adding the dependency as follows:

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

My log 4J is as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
        xmlns:log4j='http://jakarta.apache.org/log4j/'>

        <appender name="console" class="org.apache.log4j.ConsoleAppender">
            <layout class="org.apache.log4j.PatternLayout">

            </layout>
        </appender>

        <root>
                <level value="INFO" />
                <appender-ref ref="console" />
        </root>

</log4j:configuration>

And I'm starting up the node as follows:

public class SampleServerCache {
        public static void main(String[] args) throws IgniteException, 
IgniteCheckedException {
                CacheConfiguration<String, String> cacheConfiguration = new 
CacheConfiguration<String, String>();
                cacheConfiguration.setName("sampleCache");
                cacheConfiguration.setStatisticsEnabled(true);

                IgniteConfiguration igniteConfiguration = new 
IgniteConfiguration();
                igniteConfiguration.setCacheConfiguration(cacheConfiguration);

                Log4JLogger logger = new Log4JLogger("config/log4j.xml");
                igniteConfiguration.setGridLogger(logger);

                Ignition.start(igniteConfiguration);
        }
}

However, when I run this the log level is set to DEBUG instead of INFO. I 
believe the code is finding my log4j.xml because if I rename it an exception is 
thrown. It seems the configuration is being ignored.

Any ideas?

This e-mail and any attachments are confidential and intended solely for the 
addressee and may also be privileged or exempt from disclosure under applicable 
law. If you are not the addressee, or have received this e-mail in error, 
please notify the sender immediately, delete it from your system and do not 
copy, disclose or otherwise act upon any part of this e-mail or its attachments.
Internet communications are not guaranteed to be secure or virus-free. The 
Barclays Group does not accept responsibility for any loss arising from 
unauthorised access to, or interference with, any Internet communications by 
any third party, or from the transmission of any viruses. Replies to this 
e-mail may be monitored by the Barclays Group for operational or business 
reasons.
Any opinion or other information in this e-mail or its attachments that does 
not relate to the business of the Barclays Group is personal to the sender and 
is not given or endorsed by the Barclays Group.
Barclays Execution Services Limited provides support and administrative 
services across Barclays group. Barclays Execution Services Limited is an 
appointed representative of Barclays Bank UK plc, Barclays Bank plc and 
Clydesdale Financial Services Limited. Barclays Bank UK plc and Barclays Bank 
plc are authorised by the Prudential Regulation Authority and regulated by the 
Financial Conduct Authority and the Prudential Regulation Authority. Clydesdale 
Financial Services Limited is authorised and regulated by the Financial Conduct 
Authority.

Reply via email to