Re: XSL_FO generator
Hi all Do somebody know how to integrate log4j and fop?? In my project I have 2 log files created with log4j and I would put the fop output in them. The code should be like this.. Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); PatternFormatter formatter = new PatternFormatter( [%{priority}]: %{message}\n%{throwable} ); LogTarget target = null; target = new StreamTarget(System.out, formatter); hierarchy.setDefaultLogTarget(target); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.INFO); driver.setLogger(?? ) but what do I have to put instead of '??' ? Thanks a lot and sorry for my poor english and my ignorance Gian Piero - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSL_FO generator
Oh I have made confusion.. Sorry I think that this code is ok for avalon.framework.Logger. but not for log4j.This is correct?? Anybody know how to use fop with log4j?? Gian - Original Message - From: Balaji Loganathan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 3:45 PM Subject: Re: XSL_FO generator Did you tried driver.setLogger(log); ? --- Gian Piero Bottini [EMAIL PROTECTED] wrote: Hi all Do somebody know how to integrate log4j and fop?? In my project I have 2 log files created with log4j and I would put the fop output in them. The code should be like this.. Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); PatternFormatter formatter = new PatternFormatter( [%{priority}]: %{message}\n%{throwable} ); LogTarget target = null; target = new StreamTarget(System.out, formatter); hierarchy.setDefaultLogTarget(target); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.INFO); driver.setLogger(?? ) but what do I have to put instead of '??' ? Thanks a lot and sorry for my poor english and my ignorance Gian Piero - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fop + servlet + multisession
Now I'll try to encrease the debug level...(by the way how can I do that??) Now my output in the dos-Tomcat window is this ( I'm creating a pdf document 99 pages long): [INFO] [99] [INFO] [86] [INFO] [87] [INFO] [88] [INFO] Parsing of document complete, stopping renderer [INFO] [89] and it seems blocked but I don't know. but sometimes it works fine...very strange... and sometimes the servlet is called twice( why??) This is the code: . try{ XSLTInputHandler input = new XSLTInputHandler(xmlFile, xslFile); renderXML(input, response); } catch (Exception ex) { ex.printStackTrace(); } . public void renderXML(XSLTInputHandler input, HttpServletResponse response) throws ServletException { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); response.reset(); // questa riga รจ necessaria per IE che forse non capisce il SetContentType() response.setHeader(Content-Disposition,inline; filename= + Report1.pdf); response.setContentType(application/pdf); org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF); System.gc(); driver.setOutputStream(out); driver.render(input.getParser(), input.getInputSource()); System.gc(); System.out.println(stop render); byte[] content = out.toByteArray(); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } } Thanks a lot Regards Gian Piero - Original Message - From: Oleg Tkachenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 03, 2003 9:59 AM Subject: Re: fop + servlet + multisession Gian Piero Bottini wrote: I am using FOP 0.20.5rc to produce PDF files from XML and XSL-FO I use a servlet in Tomcat 4.04 if I have a large file (100 pages) and 2 session of IE are working concurrently there are no exception but the two processes don't finish and the pdf files are not displayed.. Did FOP finish processing? Run FOP in debug mode and analize debug messages. -- Oleg Tkachenko Multiconn Technologies, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fop + servlet + multisession
Thanks a lot but sometimes (with 3 session of IE) tomcat stops without exception or without particolar debug messages... Somebody have any ideas?? Could be a memory problem?? Regards Gian Piero - Original Message - From: Fabrizio Tringali [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 03, 2003 12:39 PM Subject: Re: fop + servlet + multisession ciao Gian Piero, this is the snippet to set the log level to debug -- //Setup logger Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG); driver.setLogger(logger); MessageHandler.setScreenLogger(logger); -- and sometimes the servlet is called twice( why??) it's a bug of IE 5.0/5.5 hope this help fabrizio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]