Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 83963 invoked from network); 6 Aug 2007 12:47:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2007 12:47:16 -0000 Received: (qmail 77571 invoked by uid 500); 6 Aug 2007 12:47:06 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 77545 invoked by uid 500); 6 Aug 2007 12:47:06 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 77534 invoked by uid 99); 6 Aug 2007 12:47:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 05:47:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of richardsayre@gmail.com designates 209.85.146.179 as permitted sender) Received: from [209.85.146.179] (HELO wa-out-1112.google.com) (209.85.146.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 12:47:03 +0000 Received: by wa-out-1112.google.com with SMTP id k40so2185837wah for ; Mon, 06 Aug 2007 05:46:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Sdfg1i8Tmt87QJLjm6QZyRRYG081hKV5baIOfyAjgARngqbFjkvFWQU9K+i418aiRzv9v6QDQXtg+6fe0AOetuHLtoHlkaC+pvCaepdCMFIwPjD0hmuY5jT3wPeUot9erF/ce0DNCzCwm6ILUwxqQYzggKMhIDYI7dVUqOjJ7u0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bUK7X+GSfgsBnJXibOyqAFpnccb+cjN39aB4DvtHYQFQ83e86mmhUzBCk/FYmPhjgH1woH1SWufX4sTCa8eDvSIpM4Cftq25HyAS9Y2Vpb7ftzn8cJ9O3lMspwNdHARDtvDYHmOBmYhp0NF92A9jhF5c4bDOxwumM+5adrAkG/I= Received: by 10.115.94.1 with SMTP id w1mr5599926wal.1186404402168; Mon, 06 Aug 2007 05:46:42 -0700 (PDT) Received: by 10.115.73.6 with HTTP; Mon, 6 Aug 2007 05:46:42 -0700 (PDT) Message-ID: <4a12aaf80708060546y5dcd2c6fu4d95c9e99e1ae420@mail.gmail.com> Date: Mon, 6 Aug 2007 09:16:42 -0330 From: "Richard Sayre" To: "Struts Users Mailing List" , pbenedict@apache.org Subject: Re: Exception Handling and Logging In-Reply-To: <46B15818.3040709@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4a12aaf80707290546l4d839c7bpf73eea96881c0356@mail.gmail.com> <46B15818.3040709@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org I set up my application to throw the Exceptions back and I am using Exception mapping to redirect the user to an error page. The error page displays the exception and stack trace. How do I log this to a file instead? Do I open a file stream on the JSP page or is there a better way to log this information? On 8/2/07, Paul Benedict wrote: > My applications do not catch any errors. I let them bubble out of the > Action and into an ExceptionHandler object for logging. You can log > whatever you want -- including the user -- in the handler. > > Paul > > Richard Sayre wrote: > > After reading the Mail Reader walk through, it would seem the best > > practice for handling exceptions is throwing them back to your Action > > and having a result mapped to handle each specific exception. > > > > Is this the best way to do this? > > > > If I use this method how can I log the stack of each exception that > > was thrown? I know there is a logging interceptor but I have not > > found any docs on how to use it. I would like to make an error log of > > everything that happens in the application. Is it possible to log > > other information with the Exception such as the current user? > > > > Thank you, > > > > Rich > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > > For additional commands, e-mail: user-help@struts.apache.org > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org