Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Question about logging:

Hello Gurus,

I would like to use AOP for logging. All documents talk about logging “entering” a method and “exiting”: however I didn’t see any documents which explain the true logging like logging “change in values inside a method” or before “executing a statement inside a method” etc. If somebody explain me how to do that or direct me to some web documents that would be very helpful.

 

To illustrate my requirement here is a simple method, what I would like to accomplish is remove this cross cutting concern (log statement) and write an aspect to achieve the same.

 

public  void increment(){

            int i=0; 

            log.info(“ About to increase the value of i”);

            i=i+1;

            if(i==1){

                        log.info(“ Value of i is 1 “)

            }

}

 

Any help will be deeply appreciated,

Thanks,

Ranjith Pillai.

 


Back to the top