Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-09-05       - By Laurie Harper

 Back
Try replacing the first two lines with

  log4j.rootLogger=DEBUG,R
  log4j.category.cus.util = DEBUG

That's the way I do it, anyway. If that doesn't do the trick, you
probably should follow up on the Log4J lists, since this isn't a
Struts-specific issue.

L.

johana pin wrote:
> Thank you for replay.
>
> log4j.properties:
>
> log4j.rootLogger=DEBUG
> log4j.logger.cus.util = DEBUG ,R
>
> # define the log file name
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=/IBM/WebSphere/AppServer/profiles/default/logs/server1
/CUS.log
>
>
> # Maximum log file size: 1000kb
> log4j.appender.R.MaxFileSize=1000KB
> # Keep 5 backup files
> log4j.appender.R.MaxBackupIndex=5
> # The pattern used for trace
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern= %d{dd MMM yyyy HH:mm:ss} [%t] %-5p
%c %M - %m%n
>
>
> INTERCEPTOR:
>
> package cus.util;
>
> import java.io.IOException;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.ExceptionHolder;
> import com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor;
>
> public class CustomExceptionInterceptor extends ExceptionMappingInterceptor {
>
>
>     /** Logging object. */
>     private Log log = LogFactory.getLog(getClass());
>
>     protected void publishException(ActionInvocation ai, ExceptionHolder eh) {
>         log.debug("System exception occured.");
>
>         super.publishException(ai, eh);
>         log.debug("Exception added to stack !");
>     }
> }
>
>
> This is what I've done.. What could  be wrong ?
> Thank you.
>
>
> -- -- Original Message ----
> From: Laurie Harper <laurie@(protected)>
> To: user@(protected)
> Sent: Friday, August 31, 2007 10:55:20 PM
> Subject: Re: [s2] custom ExceptionMappingInterceptor log
>
>
> johana pin wrote:
>> Hi,
>>
>> I extended 'ExceptionMappingInterceptor' to add the logging functionality. I
want to log to my own file. The problem is that the logging is done in
SystemOut file.
>>
>> I used log4j in the custom interceptor:
>> private org.apache.commons.logging.Log log = LogFactory.getLog(getClass());
>>
>> The log4j.properties file works for all the other classes in the application
, but only for this one does not (logging is done in SystemOut).
>> I did not see any custom parameter related to a log file in struts.xml. The
interceptor usage:
>> <interceptor-ref name="customExceptionInterceptor">
>>     <param name="logEnabled">true</param>
>>     <param name="logLevel">DEBUG</param>
>> </interceptor-ref>
>>
>> How this could be done ?
>> Thank you
>
> Sounds like a mis-configuration in log4j.properties, or perhaps a
> mis-use of the logging API. It's hard to tell without more details. What
> do your logging statements look like? What's in log4j.properties?
>
> L.
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>        
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
__ ____
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for
today's economy) at Yahoo! Games.
> http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.