You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "Mitchell Rathbun (BLOOMBERG/ 731 LEX)" <mr...@bloomberg.net> on 2020/02/14 00:23:59 UTC

Issue with Ignite Logging and Log4j2

I am hoping to use a separate appender for Ignite logs in my application. In my configuration file, I have:

<asyncLogger name="org.apache.ignite" level="info" additivity="false">
     <appender-ref ref="IGNITE"/>
</asyncLogger>
<asyncRoot level="info">
     <appender-ref ref="MAIN"/>
     <appender-ref ref="ActLogAppender" level="ERROR"/>
 </asyncRoot>

IGNITE and MAIN are both RollingRandomAccessFile appenders pointing to different files. In my java code I have:

File logConfigFile = new File(config.getIgniteGridLoggerXmlPath());
try {
    IgniteLogger logger = new Log4J2Logger(logConfigFile);
    ignCfg.setGridLogger(logger);
} catch (IgniteCheckedException e) {
    LOG.error("Unable to set up IgniteLogger with path {}", logConfigFile, e);
}

When I run my application, Ignite is still sending all of its logs to the same file that MAIN points to. Any idea why this doesn't work? Should the name for the logger be something different than "org.apache.ignite"?

Re: Issue with Ignite Logging and Log4j2

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Do you actually have this IGNITE appender? Also, I think this config will
lead to duplication of log lines instead of redirection.

Better ask somewhere with log4j expertise.

Regards,
-- 
Ilya Kasnacheev


пт, 14 февр. 2020 г. в 03:24, Mitchell Rathbun (BLOOMBERG/ 731 LEX) <
mrathbun1@bloomberg.net>:

> I am hoping to use a separate appender for Ignite logs in my application.
> In my configuration file, I have:
>
> <asyncLogger name="org.apache.ignite" level="info" additivity="false">
> <appender-ref ref="IGNITE"/>
> </asyncLogger>
> <asyncRoot level="info">
> <appender-ref ref="MAIN"/>
> <appender-ref ref="ActLogAppender" level="ERROR"/>
> </asyncRoot>
>
> IGNITE and MAIN are both RollingRandomAccessFile appenders pointing to
> different files. In my java code I have:
>
> File logConfigFile = new File(config.getIgniteGridLoggerXmlPath());
> try {
> IgniteLogger logger = new Log4J2Logger(logConfigFile);
> ignCfg.setGridLogger(logger);
> } catch (IgniteCheckedException e) {
> LOG.error("Unable to set up IgniteLogger with path {}", logConfigFile, e);
> }
>
> When I run my application, Ignite is still sending all of its logs to the
> same file that MAIN points to. Any idea why this doesn't work? Should the
> name for the logger be something different than "org.apache.ignite"?
>