ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Mashenkov <andrey.mashen...@gmail.com>
Subject Re: Logging ignite-log4j.jar
Date Tue, 28 Mar 2017 14:35:22 GMT
Hi Sam,

I see you've cross-posted this as comment to ticket.
I've already made a fix regarding your suggestion and reposted this to
dev-list.

On Fri, Mar 24, 2017 at 9:25 PM, javastuff.sam@gmail.com <
javastuff.sam@gmail.com> wrote:

> Thanks Andrey.
>
> Looked at code and seems like check for log configuration is made,
> /                    if(!isConfigured()) {
>                         this.impl.setLevel(Level.OFF);
>                     }/
>
> but not completely correct. Below is the method from Log4JLogger
>
> /    public static boolean isConfigured() {
>         return Logger.getRootLogger().getAllAppenders().hasMoreElements();
>     } /
>
> It is looking at appenders from rootLogger only. It should also check for
> other Loggers. Probably below code should fix it.
>
> /    public static boolean isConfigured() {
>         Enumeration appenders = Logger.getRootLogger().getAllAppenders();
>         if (appenders.hasMoreElements()) {
>             return true;
>         }
>         else {
>             Enumeration loggers = LogManager.getCurrentLoggers() ;
>             while (loggers.hasMoreElements()) {
>                 Logger c = (Logger) loggers.nextElement();
>                 if (c.getAllAppenders().hasMoreElements())
>                     return true;
>             }
>         }
>         return false;
>     }/
>
> Thanks,
> -Sam
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Logging-ignite-log4j-jar-tp11400p11439.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Mime
View raw message