No, it's not a must, but it's used by Ignite for resolving relative paths when set.
2016-04-18 9:29 GMT+03:00 Kamal C <[email protected]>: > Is IGNITE_HOME environmental variable is must? (In docs, it's stated as > optional) > > With `Log4J2Logger`, I've added the log4j2.xml in my application > class-path, then it throws: > > class org.apache.ignite.IgniteCheckedException: Log4j configuration path > was not found: log4j2.xml > at > org.apache.ignite.logger.log4j2.Log4J2Logger.<init>(Log4J2Logger.java:143) > at > com.nmsworks.ignite.examples.servicegrid.server.ServerNode.getIgniteConfig(ServerNode.java:150) > at > com.nmsworks.ignite.examples.servicegrid.server.ServerNode.main(ServerNode.java:69) > > Similarly, for: > Ignition.start("conf/ignite/ignite-server.xml"); > > After adding the environmental variable, the issue resolved. > > --Kamal > > > On Mon, Apr 18, 2016 at 10:55 AM, Kamal C <[email protected]> wrote: > >> Alexei, >> >> Thanks for your response! >> >> I've used slf4j to re-direct the logs >> >> IgniteConfiguration cfg = new IgniteConfiguration(); >> ... >> cfg.setGridLogger(new Slf4jLogger()); >> Ignition.start(cfg); >> >> Added the ignite-slf4j-1.5.0.final.jar, slf4j-api-1.7.7.jar and >> slf4j-log4j12-1.7.6.jar to the classpath >> >> --Kamal >> >> >> On Sun, Apr 17, 2016 at 6:03 PM, Alexei Scherbakov < >> [email protected]> wrote: >> >>> Hi, >>> >>> >>> For embedded mode you can try something like this: >>> >>> IgniteConfiguration cfg = new IgniteConfiguration(); >>> ... >>> cfg.setGridLogger(new Log4J2Logger(U.resolveIgniteUrl("log4j2.xml", >>> false))); >>> Ignition.start(cfg); >>> >>> The key point here is to tell Ignite to use Log4J2 implementation for >>> logging. >>> Make sure you have log4j2.xml on your classpath. >>> >>> >>> 2016-04-16 15:40 GMT+03:00 Kamal C <[email protected]>: >>> >>>> Hi >>>> >>>> I'm not able to re-direct the Ignite logs to log4j2. I tried it by >>>> adding the optional `ignite-log4j2` directory to the class path and added >>>> the log4j2.xml. Still, the logs thrown to the console. >>>> >>>> Can anyone tell how to re-direct the logs? >>>> >>>> --Kamal >>>> >>> >>> >>> >>> -- >>> >>> Best regards, >>> Alexei Scherbakov >>> >> >> > -- Best regards, Alexei Scherbakov
