Menu

#7 FOP message handling

open
nobody
None
3
2004-03-29
2004-01-13
Joe O'Pecko
No

First off let me say that I am very pleased with this
project. Excellent work! It has made integrating various
view technologies into my applications effortless.

I have one request for enhancement though.

When using the CachedFOPTransformer to render pdf
content, you set the FOP Driver's logger to an instance
of your adapter class, AvalonLogger. This handles per-
instance logging. However, global logging for all FOP
processes is managed by
org.apache.fop.messaging.MessageHandler.

Per the FOP documentation found at:
http://xml.apache.org/fop/embedding.html#basic-logging

<quote>
You also need to set up logging. Global logging for all
FOP processes is managed by MessageHandler. Per-
instance logging is handled by Driver. You want to set
both using an implementation of
org.apache.avalon.framework.logger.Logger. See below
for more information.

Call setLogger(Logger) always immediately after
instantiating the Driver object. See here:

import org.apache.avalon.framework.logger.Logger;
import
org.apache.avalon.framework.logger.ConsoleLogger;

/*..*/

Driver driver = new Driver();
Logger logger = new ConsoleLogger
(ConsoleLogger.LEVEL_INFO);
MessageHandler.setScreenLogger(logger);
driver.setLogger(logger);

</quote>

When running stxx as is, the following output is sent to
the console, i.e. System.out stream:
[ERROR] Logger not set
[INFO] building formatting object tree
[WARNING] Screen logger not set - Using ConsoleLogger.
[INFO] setting up fonts
[INFO] [1]
[INFO] JAI support was not installed (read: not present
at build time). Trying to use Jimi instead
[INFO] [1]
[INFO] Parsing of document complete, stopping renderer

Note that the Driver generated log messages do make it
into the log as expected.

Is it possible for you to add the appropriate initialization
code for the MessageHandler class into your framework.
The reason I am asking is that in my particular corporate
environment, our applications run within a shared JVM
and any writing to System.out will have to contest with
potentially hundereds of applications for the server's log
file.

What do you think?

As always thanks for your support.

Discussion

  • Don Brown

    Don Brown - 2004-03-29

    Logged In: YES
    user_id=255188

    Sounds like a good idea, however I don't have the time to
    implement this. If you submit a patch, I'd be happy to put
    it in.

     
  • Don Brown

    Don Brown - 2004-03-29
    • priority: 5 --> 3
     

Log in to post a comment.