I am trying to modify the runtime behavior on the log4j.

Here is my implementation: 

public static Logger getLogger(Class c) {
                
                Logger logger = Logger.getLogger(c);
                         String pattern = "%d{dd-MMM-yyyy HH:mm:ss,SSS} %p
%c{3} (%M:%L)- %m%n";
                
                PatternLayout layout = new PatternLayout(pattern);
                ConsoleAppender appender = new ConsoleAppender(layout);
                
                logger.addAppender(appender);
                     return logger;
        }

The caller is showed as beloew:

static Logger logger = AccountAccessUtil.getLogger(Domain.class);

However I am getting the following:
28-Sep-2011 16:43:22,777 DEBUG plugin.retailCustomer.Domain
(enrichedQuery:113)- ** lalalala **
2011-09-28 16:43:22,777 | main | DEBUG | plugin.retailCustomer.Domain | **
lalalala **

Is there anyway that I can get rid of second logging? Please note that I
have no control on log4j.properties file.

thanks,

Jason
-- 
View this message in context: 
http://old.nabble.com/Getting-duplicated-logging-in-console-log-tp32549974p32549974.html
Sent from the Log4j - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to