Hello! 

I use FOP 0.20.4 to generate PDF into a servlet and I have some problems
with logs. first, I have a message into the console of Tomcat that says :
[WARNING] Screen logger not set. And when I generate the PDF with FOP, I
have no logs into the file I specified : my log file is created but is
empty.

The PDF file is well created.

Here is the source code of a part of my servlet : 

    private byte[] renderXML(File xmlFile, String pathXslFile) throws
MyException { 
        File xslFile = new File(pathXslFile); 
        XSLTInputHandler input = new XSLTInputHandler(xmlFile, xslFile); 
        try { 
            ByteArrayOutputStream out = new ByteArrayOutputStream(); 

            Driver driver = new Driver(); 
            org.apache.log.Logger log; 
            log =
org.apache.log.Hierarchy.getDefaultHierarchy().getLoggerFor("fop"); 
                org.apache.log.format.PatternFormatter formatter = new
org.apache.log.format.PatternFormatter(pattern); 
            try { 
                 org.apache.log.output.io.FileTarget fileTarget = new
org.apache.log.output.io.FileTarget(new File("myLogFile.log"), false,
formatter);

                 log.setLogTargets(new
org.apache.log.LogTarget[]{fileTarget}); 
            } catch (IOException ex) { 
                 ... 
            } 
 
log.setPriority(org.apache.log.Priority.getPriorityForName("DEBUG")); 
            driver.setLogger(new
org.apache.avalon.framework.logger.LogKitLogger(log)); 
            driver.setRenderer(Driver.RENDER_PDF); 
            driver.setOutputStream(out); 

            driver.render(input.getParser(), input.getInputSource()); 

            return out.toByteArray(); 

        } catch (Exception ex) { 
            ... 
        } 
    } 

Where is the problem, please ? 

Thanks, 
Christophe BESSON. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to