Is Spring AOP really an effective strategy for logging?
I’m trying to set up a logging strategy for my company with the idea of making it as simple for the developers as possible. We could possibly have hundreds of classes that are in our application and while most likely, all will not need to log, I would like the opportunity to do so.
My plan was to monitor every time the following method was called from possibly a Ilogging Interface:
writeMessage(String level, String msg)
Is there a way to monitor this writeMessage call without having to wire the hundreds of apps within my xml? I have seen proxies used but that would seem to just blow up my xml, not mention having to know every single class that needs a proxy. Is there a way to minimize the wiring in my Spring xml while still being able to monitor that message call for all hundred apps?
Code:
public class SomeApp1 implements ILoggingService {
public void otherSomething() {
writeMessage("Info", "OtherClass wants to log");
}
@Override
public void writeMessage(String level, String message) {
// TODO Auto-generated method stub
}
}