You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Gross <m....@evolt.de> on 2003/05/22 19:35:58 UTC

Custom ExceptionHandler and Logging

 Hi,

   I subclassed org.apache.struts.action.ExceptionHandler for a Custom
   ExceptionHandler, which I want to use for logging of the
   application exceptions in the tomcat log files.

   In an Action class I can use something like
   "servlet.log("Exception", exception)".
   But in ExceptionHandler "servlet" (aka ActionServlet) is not
   available. How can I get an instance of an ActionServlet im my
   custom Exception Handler or are there other ways to log my messages
   into the tomcat logs?

Regards,
 Martin

.....................................
 EVOLT Internet Applications GmbH
 Brüningstrasse 35
 61350 Bad Homburg, Germany
 Tel. (06172) 78970-0
 Fax. (06172) 78970-29
 http://www.evolt.de
.....................................


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re[2]: Custom ExceptionHandler and Logging

Posted by Martin Gross <m....@evolt.de>.
hi navjot,

  i am using the commons-logging api together with log4j now. i guess
  it was the right time to switch from tomcat logging to another
  logging system with all the advantages.

martin

> IMO,
> you should keep your exception messages separate from your tomcat log file.

> tyr using JDK1.4 lgging or log4j for exception logging
> using FileHandler. You may also like to define the format of
> your log messages.

> -navjot

> |-----Original Message-----
> |From: Martin Gross [mailto:m.gross@evolt.de]
> |Sent: Thursday, May 22, 2003 11:06 PM
> |To: Struts Users Mailing List
> |Subject: Custom ExceptionHandler and Logging
> |
> |
> | Hi,
> |
> |   I subclassed org.apache.struts.action.ExceptionHandler for a Custom
> |   ExceptionHandler, which I want to use for logging of the
> |   application exceptions in the tomcat log files.
> |
> |   In an Action class I can use something like
> |   "servlet.log("Exception", exception)".
> |   But in ExceptionHandler "servlet" (aka ActionServlet) is not
> |   available. How can I get an instance of an ActionServlet im my
> |   custom Exception Handler or are there other ways to log my messages
> |   into the tomcat logs?
> |
> |Regards,
> | Martin
> |
> |.....................................
> | EVOLT Internet Applications GmbH
> | Brüningstrasse 35
> | 61350 Bad Homburg, Germany
> | Tel. (06172) 78970-0
> | Fax. (06172) 78970-29
> | http://www.evolt.de
> |.....................................
> |
> |
> |---------------------------------------------------------------------
> |To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> |For additional commands, e-mail: struts-user-help@jakarta.apache.org
> |
> |


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Custom ExceptionHandler and Logging

Posted by Navjot Singh <na...@net4india.net>.
IMO,
you should keep your exception messages separate from your tomcat log file.

tyr using JDK1.4 lgging or log4j for exception logging
using FileHandler. You may also like to define the format of
your log messages.

-navjot

|-----Original Message-----
|From: Martin Gross [mailto:m.gross@evolt.de]
|Sent: Thursday, May 22, 2003 11:06 PM
|To: Struts Users Mailing List
|Subject: Custom ExceptionHandler and Logging
|
|
| Hi,
|
|   I subclassed org.apache.struts.action.ExceptionHandler for a Custom
|   ExceptionHandler, which I want to use for logging of the
|   application exceptions in the tomcat log files.
|
|   In an Action class I can use something like
|   "servlet.log("Exception", exception)".
|   But in ExceptionHandler "servlet" (aka ActionServlet) is not
|   available. How can I get an instance of an ActionServlet im my
|   custom Exception Handler or are there other ways to log my messages
|   into the tomcat logs?
|
|Regards,
| Martin
|
|.....................................
| EVOLT Internet Applications GmbH
| Brüningstrasse 35
| 61350 Bad Homburg, Germany
| Tel. (06172) 78970-0
| Fax. (06172) 78970-29
| http://www.evolt.de
|.....................................
|
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
|For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org