Mikhail has posted 3 posts at DZone. View Full User Profile
Using Spring AOP to Trace Invocation    • submit to reddit  How
often do you write something like this?  public void foo(){
logger.debug("entering foo"); logger.debug("leaving foo");  If
your answer is "often enough", then you should consider the
following info. Anyone using Spring framework DebugInterceptor
(or any other interceptor of your choice) can seamlessly
integrate trace logging into his application, just with slight
modification to their spring context configs. In this post I
will describe how to trace your code using Spring AOP
package com.blogspot.mikler.java;  import
org.apache.log4j.Logger;  public class Bean1 {  Logger logger =
Logger.getLogger(Bean1.class);  Bean2 bean2;  public void
entryPoint(){ bean2.doSomethingQuick("a job"); logger.info("All
jobs done");  public void setBean2(Bean2 bean2) { this.bean2 =
bean2;    package com.blogspot.mikler.java;  import
org.apache.log4j.Logger;  import java.text.MessageFormat;
public class