I tried that, it logs well. But I would like to have the log written to
file.
This doesn't work:

FileOutputStream fos = new FileOutputStream(filename);
PrintStream ps = new PrintStream(fos);
PrintStream out_orig = System.out;
System.setOut(ps);
....
here I run FOP
...
fos.close();
System.setOut(out_orig);

In this forum I was recommended this ( by [EMAIL PROTECTED]) :

"FOP uses a logger for logging, depending on which version etc. you are
probably using avalon logkit.
I don't know exactly how it works but it probably directs the log output
to stdout and not the stream that you set as the system output.

The proper way to handle it would be to configure your logger. For
example the avalon logger this would be the place to start:
http://jakarta.apache.org/avalon/logkit/";

... so I dit it (the code is shown in first message), but  the [DEBUG]
lines are not logged, even if I do this

log.setPriority(Priority.DEBUG);






                                                                                
                                   
                    Oleg Tkachenko                                              
                                   
                    <[EMAIL PROTECTED]       Komu:   [EMAIL PROTECTED]          
                                 
                    nn.com>              Kopie:                                 
                                   
                                         Předmět:     Re: Cannot log the same 
as fop.bat with -d option            
                    20.11.2002                                                  
                                   
                    11:23                                                       
                                   
                    Odpovězte                                                   
                                   
                    prosím                                                      
                                   
                    uživateli                                                   
                                   
                    fop-user                                                    
                                   
                                                                                
                                   
                                                                                
                                   




[EMAIL PROTECTED] wrote:

> What I must do, to make logger log everything, as FOP.BAT (with -d
option)
> does  ?

Take a look at FopServlet.java example:

import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;
...
Logger log = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);
MessageHandler.setScreenLogger(log);
...
driver.setLogger(log);

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel





Reply via email to