You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Pa...@ercgroup.com on 2003/04/28 21:08:31 UTC

Log statements logged incrementally

Hi I have the following custom LogConfigurator

public class ProdLogConfigurator extends BasicConfigurator implements
LogConfigurator {

    public AsyncAppender appender;

    public void config() throws IOException {

        try {
            if ( appenderFileName != null ) {
                appender.addAppender ( new DailyRollingFileAppender( new
PatternLayout(layout), appenderFileName, "'.'yyyy-MM-dd" ) );
                appender.addAppender ( new ConsoleAppender( new
PatternLayout(layout) ) );
            }
            else {
                appender.addAppender ( new ConsoleAppender( new
PatternLayout(layout) ) );
            }
        }
        catch ( IOException ioe ) {
			ioe.printStackTrace();
			throw ioe;
        }

        Category root = Category.getInstance("ercrio.rio");
        if ( priority == null ) {
            root.setPriority ( Priority.ERROR );//1.1.3
            //root.setLevel ( Level.ERROR );//1.2.7
        }
        else {
            root.setPriority ( Priority.toPriority( priority, Priority.ERROR
) );//1.1.3
            //root.setLevel ( Level.toLevel( priority, Level.ERROR )
);//1.2.7
        }

    	root.addAppender(appender);
     }

I am using this logger in the some class. When the application logs the
staements to log file and console it logs a singlr statement incrementally
with each call. I mean first call to log.debug prints once and second call
prints the same line 2 times and the third prints 3 times and so on.

Could anybody explain what would be the problem

Thanks

Kind regards,
Pankaj Jaiprakash Kankatti
Mascot Systems
    
> % Off		:  +49 - (0) 89 - 9228 1705
> % Mobile	:  +49 - (0) 172 85 87 147
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org