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 Gordon Ross <G....@ccw.gov.uk> on 2004/08/11 22:27:32 UTC

Logging as Servlet output

I'm running FOP from within a servlet. What I would like to do, is send FOPs logging output as the output of the servlet (not the PDF file)

I've been looking at the docs, and from what I can see, I need to use the log4j logging framework, as that is the only one that supports logging to a Writer. What I seem to be missing, is how to link log4j into the Avalon framework.

Can someone point me in the right direction ?

Thanks,

GTG

Gordon Ross,
Network Manager/Rheolwr Rhydwaith
Countryside Council for Wales/Cyngor Cefn Gwlad Cymru

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


Re: Logging as Servlet output

Posted by Jeremias Maerki <de...@greenmail.ch>.
You don't need Log4J for that. You can do that simply be creating a
class that implements the org.apache.avalon.framework.logger.Logger
interface. You can the use it instead of ConsoleLogger, Log4JLogger,
NullLogger etc. as shown here:
http://xml.apache.org/fop/embedding.html#basic-logging
http://xml.apache.org/fop/embedding.html#logging

In your implementation you can specify a Writer in the constructor and
write to it in every method that is defined be the Logger interface. If
you want to look at a few examples of such Logger implementations, see
here:
http://svn.apache.org/repos/asf/avalon/trunk/runtime/framework/impl/src/java/org/apache/avalon/framework/logger/

I hope that helps.

On 11.08.2004 22:27:32 Gordon Ross wrote:
> I'm running FOP from within a servlet. What I would like to do, is send
> FOPs logging output as the output of the servlet (not the PDF file)
> 
> I've been looking at the docs, and from what I can see, I need to use
> the log4j logging framework, as that is the only one that supports
> logging to a Writer. What I seem to be missing, is how to link log4j
> into the Avalon framework.
> 
> Can someone point me in the right direction ?



Jeremias Maerki


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