You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Melih Ovadya <mo...@jaspersoft.com> on 2006/02/15 00:04:14 UTC

Logger question

Hi,

I am having difficulties with the priority settings of the logger FOP is
using. I use org.apache.log4j, I set the priority of my loggers in
log4j.xml, and it works fine everywhere in my code except when using FOP.
Can someone please point me out what I am missing here?

In my log4j.xml file, I declare the priority as following:

<category name=" myPackage.MyFOPRenderer ">
        <priority value="info"/>
</category>


And in myPackage.MyFOPRenderer.java, I set the FOP logger in two places as
following:

import org.apache.avalon.framework.logger.Log4JLogger;
import org.apache.fop.apps.Driver;
import org.apache.fop.messaging.MessageHandler;
import org.apache.log4j.Logger;

public static synchronized void initialize(...){
        ...
        Log4JLogger log4JLogger = new
Log4JLogger(Logger.getLogger(MyFOPRenderer.class));
        MessageHandler.setScreenLogger(log4JLogger);
	        ...    
}


public void render(...) {
                Driver driver = new Driver();
                Log4JLogger log4JLogger = new
Log4JLogger(Logger.getLogger(MyFOPRenderer.class));
                	driver.setLogger(log4JLogger);
                ...
    }


Why has the priority setting got lost in driver all of a sudden?

Thanks in advance.





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org