Return-Path: Delivered-To: apmail-xmlgraphics-fop-users-archive@www.apache.org Received: (qmail 39639 invoked from network); 5 Jul 2006 14:47:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2006 14:47:47 -0000 Received: (qmail 69571 invoked by uid 500); 5 Jul 2006 14:47:44 -0000 Delivered-To: apmail-xmlgraphics-fop-users-archive@xmlgraphics.apache.org Received: (qmail 69547 invoked by uid 500); 5 Jul 2006 14:47:44 -0000 Mailing-List: contact fop-users-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-users@xmlgraphics.apache.org Delivered-To: mailing list fop-users@xmlgraphics.apache.org Received: (qmail 69536 invoked by uid 99); 5 Jul 2006 14:47:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 07:47:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ap-fop-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 07:47:43 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Fy8dL-0004KK-4k for fop-users@xmlgraphics.apache.org; Wed, 05 Jul 2006 16:45:43 +0200 Received: from mail2.hayesinc.com ([207.10.43.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jul 2006 16:45:43 +0200 Received: from aperez by mail2.hayesinc.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jul 2006 16:45:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: fop-users@xmlgraphics.apache.org From: Arturo Perez Subject: Re: FOP 0.92b Logger Date: Wed, 5 Jul 2006 14:43:57 +0000 (UTC) Lines: 66 Message-ID: References: <743B49C43C0964459527F8E8D4B04D8A57A0C7@mercure.takoma.fr> <200607032050.40924.manuel@apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 207.10.43.2 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Heinzer David wanadoo.fr> writes: > > Thanks a lot everybody for your help ! :) > Now, with all your advises, I will try to resolve my problem... :) > It's right log4j is very powerful, I made some examples to understand its use, > it's relatively easy. But if I understand well, with FOP, the only thing to do > is to configure the ouput display with configuration of Jakarta, the "abstract > layer" between FOP and , by example, log4j. > > Arturo, if you always agree, I will be interesting for your code. > I thank you in advance. > > Best regards > > Heinzer David > heinzer.david AT wanadoo.fr > Here's what I do: // this part goes just before you start the FOP rendering process Logger fopLogger = Logger.getLogger("org.apache.fop"); NullOutputStream errorOutput = new NullOutputStream(); Appender errorAppender = new WriterAppender(new ActionErrorLayout(errors, infoMsgs), errorOutput); fopLogger.addAppender(errorAppender); // this class converts the LoggingEvent into Struts ActionMessage. class ActionErrorLayout extends Layout { ActionErrors errors; ActionMessages messages; public ActionErrorLayout(ActionErrors errors, ActionMessages infoMsgs) { this.errors = errors; this.messages = infoMsgs; } public String format(LoggingEvent arg0) { if (arg0.getLevel() == org.apache.log4j.Level.ERROR) { ActionError nextError = new ActionError("error.SAXErrorWrapper", arg0.getMessage()); errors.add(ActionErrors.GLOBAL_ERROR, nextError); } else { ActionMessage nextMsg = new ActionMessage("error.SAXErrorWrapper", arg0.getMessage()); messages.add(ActionMessages.GLOBAL_MESSAGE, nextMsg); } return ""; } public boolean ignoresThrowable() { return true; } public void activateOptions() { } } HTH, arturo --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org