You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Ulrich Mayring <ul...@denic.de> on 2001/11/20 11:43:31 UTC

How to set up external logger?

Hello,

I've written an Avalon block as a wrapper for fop, xalan, batik and
naturally my Phoenix applications, that use this block, have their own
logger. It's retrieved in the standard Avalon way by calling
getLogger(), so I've tried this:

{Class extends AbtractLoggable}
...
Driver driver = new Driver();
driver.setLogger(getLogger());

This compiles fine and my application works fine, too. However, fop's
log output goes to System.out instead of the log file. Normally, when
using Avalon's logger, I just write things like:

getLogger().debug("shows up when log level is DEBUG");
getLogger().info("shows up when log level is INFO");
getLogger().error("shows up when log level is ERROR");

So if fop calls these methods as well, it should theoretically work. Any
tips on what goes wrong here?

cheers,

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: How to set up external logger?

Posted by Ulrich Mayring <ul...@denic.de>.
Jeremias Maerki wrote:
> 
> Hallo Ulrich
> 
> The problem probably lies in org.apache.fop.messaging.MessageHandler
> which is used in a static context and constructs it's own Logger. FOP
> still needs some refactoring to do logging cleanly.
> 
> All you probably need is to also set the Logger on MessageHandler.

MessageHandler.setOutputMethod(MessageHandler.FILE) does it, thanks a
lot.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: How to set up external logger?

Posted by Jeremias Maerki <je...@outline.ch>.
Hallo Ulrich

The problem probably lies in org.apache.fop.messaging.MessageHandler
which is used in a static context and constructs it's own Logger. FOP
still needs some refactoring to do logging cleanly.

All you probably need is to also set the Logger on MessageHandler.

Good luck!

On Tue, 20 Nov 2001 11:43:31 +0100 Ulrich Mayring wrote:
> Hello,
> 
> I've written an Avalon block as a wrapper for fop, xalan, batik and
> naturally my Phoenix applications, that use this block, have their own
> logger. It's retrieved in the standard Avalon way by calling
> getLogger(), so I've tried this:
> 
> {Class extends AbtractLoggable}
> ...
> Driver driver = new Driver();
> driver.setLogger(getLogger());
> 
> This compiles fine and my application works fine, too. However, fop's
> log output goes to System.out instead of the log file. Normally, when
> using Avalon's logger, I just write things like:
> 
> getLogger().debug("shows up when log level is DEBUG");
> getLogger().info("shows up when log level is INFO");
> getLogger().error("shows up when log level is ERROR");
> 
> So if fop calls these methods as well, it should theoretically work. Any
> tips on what goes wrong here?
> 
> cheers,
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org