This page shows how you set up logging in FOP via java.util.logging (JDK 1.4 and later).
Apache FOP version 0.90 and later use Apache Jakarta Commons Logging as the logging API which allows logging to any logging backend (Log4J, JDK logging etc.). Please check the Commons Logging documentation and the documentation of your preferred logging backend for any details.
Step by step
1. Create a logging configuration file
There's an example file you can start from in your JDK/JRE: jre/lib/logging.properties. You can copy this file any modify it as you wish.
Here's an minimal example logging.properties that logs to the console:
handlers= java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = FINEST java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter .level= INFO # Well, the following line actually dances a little out of line :-( FOP.level = INFO # This sets all FOP logging to INFO. Only rendering information is logged on the FINE level. org.apache.fop.level = INFO org.apache.fop.render.level = FINE
2. Tell java.util.logging to use your configuration file
Set the following system property when you start the JVM:
That's already it. If you're on J2SE 1.4 or later Commons Logging is used automatically if you don't have Log4J in your classpath. If you want to do some more fancy, please check the Commons Logging documentation.