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 Samuel Penn <sa...@glendale.org.uk> on 2008/01/13 15:39:21 UTC

Missing log4j appender

I have just upgraded to fop 0.93 from 0.20.5, on Gentoo Linux, and
I'm now running into some issues whenever I try to process files
which worked prior to the upgrade.

Running fop, I get the following error:

log4j:WARN No appenders could be found for logger
(org.apache.fop.render.RendererFactory).
log4j:WARN Please initialize the log4j system properly.

An empty output file is generated, then deleted. This error is thrown
even if I just run fop by itself (I get that error, followed by a usage).

I can see three possible causes:

  1) It's a Gentoo issue, and not a FOP issue.

  2) It's not a log4j issue (it is reported as a warning after all),
     and something has changed which is causing some other failure
     which can't be logged. Setting up log4j will tell me what the
     real problem is.

  3) log4j needs to be setup somehow, which will fix the problem.

Assuming 2 or 3, how do I setup a suitable log4j configuration file
and pass it to fop when running it from the command line?

Thanks,

Sam.



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


Re: Missing log4j appender

Posted by Samuel Penn <sa...@glendale.org.uk>.
Andreas Siepert wrote:

> Hi Samuel,
> 
> this is the typical output for not having configured log4j.
> To configure it you can for example place a log4j.properties file into
> your classpath (something like ../classes/log4j.properties) but there
> are some options.

Okay, adding a properties file to the current directory showed the
error. Presumably previous versions (either by default, or installed
as part of the Gentoo package) defined a properties file (or didn't
use log4j).

It appears that the real error was:

javax.xml.transform.TransformerException: file:///tmp/character.fo:2:351:
Error(2/351): For fo:simple-page-master, fo:region-body must be declared
before fo:region-before.


Changing my XSLT has fixed the problem. Presumably this requirement has
changed in the rewrite between .2 and .9, since it never complained
about it before. I've also noted some other differences in the new
rendering engine - time to revisit my XSLT I think!

Thanks for the help,

Sam.



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


Re: Missing log4j appender

Posted by Andreas Siepert <an...@bader-jene.de>.
Hi Samuel,

this is the typical output for not having configured log4j.
To configure it you can for example place a log4j.properties file into 
your classpath (something like ../classes/log4j.properties) but there 
are some options.
A sample content for such a properties file is:

<code>
log4j.rootLogger=DEBUG, CONSOLE

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

log4j.appender.CONSOLE.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x 
- %m%n

log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
log4j.appender.FILE.file=logs/app.log
</code>

This will log every DEBUG output (or higher level output like WARN, 
ERROR, FATAL) to the app.log file in the log directory.

For more details see the log4j page http://logging.apache.org/log4j/

Probably, configuring log4j will reveal some real issues using fop...

Greetings
Andi

Samuel Penn schrieb:
> I have just upgraded to fop 0.93 from 0.20.5, on Gentoo Linux, and
> I'm now running into some issues whenever I try to process files
> which worked prior to the upgrade.
>
> Running fop, I get the following error:
>
> log4j:WARN No appenders could be found for logger
> (org.apache.fop.render.RendererFactory).
> log4j:WARN Please initialize the log4j system properly.
>
> An empty output file is generated, then deleted. This error is thrown
> even if I just run fop by itself (I get that error, followed by a usage).
>
> I can see three possible causes:
>
>   1) It's a Gentoo issue, and not a FOP issue.
>
>   2) It's not a log4j issue (it is reported as a warning after all),
>      and something has changed which is causing some other failure
>      which can't be logged. Setting up log4j will tell me what the
>      real problem is.
>
>   3) log4j needs to be setup somehow, which will fix the problem.
>
> Assuming 2 or 3, how do I setup a suitable log4j configuration file
> and pass it to fop when running it from the command line?
>
> Thanks,
>
> Sam.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
>   


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