Results 1 to 2 of 2

Thread: Problem with CustomizableTraceInterceptor

  1. #1

    Default Problem with CustomizableTraceInterceptor

    CustomizableTraceInterceptor has a feature by which I could ask AOP to put the log message under the object being intercepted. So instead of logs appearing as

    Code:
    org.springframework.aop.interceptor.CustomizableTraceInterceptor:invokeUnderTrace
    I would like the logs to appear as
    Code:
    com.mycompany.web.aop.CustomInterceptor:methodName
    This feature is not working. It's not working because inherently it seems log4j and commons log don't support creating logger for a different class. For example let's look at this class.
    Code:
    public class A {
    	public void testing() {
    		Logger log = Logger.getLogger(B.class);
    		log.debug("### testing");
    	}
    }
    The generated log message is

    Code:
    com.mycompany.A:test:4) - ### testing
    Here I am using log4j and I have created logger for class 'B'. Even though the logger is created for classs 'B' the generated log has 'com.mycompany.A' instead of 'com.mycompany.B'.

    Am I missing something here?
    Neeraj Kumar

  2. #2

    Default

    The problem was the configuration with my log4j.properties file.

    This is what I had
    Code:
    log4j.appender.stdout.layout.ConversionPattern=%p [%t] %C.%M(%L) | %m%n
    Notice the capital "C". As per the log4j doc

    %C: Outputs the fully-qualified class name of the caller issuing the logging request.


    %c: Outputs the category of the logging event.
    Switching from uppercase 'C' to lowercase 'c' solved the problem.
    Neeraj Kumar

Similar Threads

  1. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  2. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  3. Replies: 0
    Last Post: Feb 16th, 2005, 01:45 PM
  4. Oracle Jdbc invalid url problem
    By jfuchs in forum Data
    Replies: 5
    Last Post: Nov 1st, 2004, 11:33 AM
  5. Lazy Load Problem when Doing UnitTest
    By yoshi in forum Data
    Replies: 7
    Last Post: Sep 29th, 2004, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •