tags:

views:

86

answers:

2

How would I disable the logging output (usually sent to stderr) that FOP automatically generates when processing an FO file?

I've tried putting a log4j.properties file in the classpath, changing the log-level for org.apache.fop but this hasn't worked.

A: 

Don't know FOP but you can always redirect the STDERR to where ever you like with code like the following:

File errDumpFile = new File("Path\to\a\File")
FileOutputStream fos = new FileOutputStream(errDumpFile);
PrintStream ps = new PrintStream(fos);
System.setErr(ps);

Note: you don't have to redirect to a file, the PrintStream can take any OutputStream.

Yaneeve
+1  A: 

FOP is open source. Have you had a look at the source to see if there is a flag controlling the print and if it can be set easily from your code?

Thorbjørn Ravn Andersen