I\'ve been working with a company that, in this current project, has to implement a policy of writing lots of trace logging in code (JAVA) that has already been completed for so
The best way is to use AOP and Java annotations. I would recommend to use @Loggable annotation and an AspectJ aspect from jcabi-aspects (I'm a developer):
@Loggable(Loggable.DEBUG)
public String load(URL url) {
return url.openConnection().getContent();
}