xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: Redirecting the output from FOP to a log file?
Date Thu, 16 Apr 2009 18:21:20 GMT
On 15 Apr 2009, at 16:00, Phill wrote:

Hi

> I'm new to java, but I've written a small java service which uses  
> the FOP library. Every time FOP generates a PDF, there are a lot of  
> warnings spat out on the console. Is there any way I can disable the  
> render warnings and then filter any serious messages to a log file?

In FOP 0.95, you cannot really 'disable' the warnings, unless by  
changing the log-level.
What is definitely possible, is to create your own logger subclass,  
and add the desired behavior in its warn() or error() handler.

Note:
* as FOP uses Jakarta Commons Logging as an abstraction layer, this  
all depends greatly on the actual log implementation that is used  
(Log4J, standard JDK logging...)
* FOP uses static loggers, so if your application possible runs  
multithreaded, you may need to use a ThreadLocal to sort out which  
message comes from which thread (Suggestion: search the fop-users  
archive for "Log4J" and "ThreadLocal", as I am quite sure a similar  
question was answered in the past couple of weeks)

see also: http://xmlgraphics.apache.org/fop/0.95/embedding.html#basic-logging

If you can use FOP Trunk (stable enough for a lot of our users), you  
get a whole new range of possibilities for handling 'events'.
See: http://xmlgraphics.apache.org/fop/trunk/events.html


HTH!

Andreas

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


Mime
View raw message