logging intercept help needed
Hi,
I am new to spring..implementing logging aspect...i have couple of questions
1) my java objects do not have interfaces.do i need to create interfaces to all of my java objects to use logging aspect with spring.if yes then is there any easy solution...
2) generally we have log statements to print a value or who logged or return values from a particular method call inside a method like below..Can these also be proxied through interceptors ?
public myMethod (list a, string b) {
log.debug ("user : " + session.getUser ());
log.debug ("value of b" + b);
list c = getEmplyoeesFromDB ();
log.debug ("Employees from db : "+ c);
}
in the above method i have 3 log statements...can i take those out and have in my interceptor so that my developer can enable particular logging for a particular method if needed through patterns in xml ..if yes can u provide a sample code or config to do same..if not then can we only trace before, after calling a method and during exceptions..and still we need to write custom logging inside mehods ?
appreciate ur help..
thanks in advance