4

I need to understand a quite large Java project. I browse through it with eclipse and use the call hierarchy and all, but that doesnt get me quite the idea on what is happening when the project runs (it's a webservice).

Is there a possibility to print out every method call with parameters to console? Basically something that puts

System.out.println("methodName, params: " + param1.toString());

in every method for me. Some kind of framework that provides that for example?

1

1 Answer 1

4

You should try to use Aspect-oriented programming (AOP).

Here is an example that does more or less what you want: How to use AOP with AspectJ for logging?

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a bunch, although the topic seems intimidating at first, I got it all running :) For anyone else who wants to log their method calls but does not want to go deeper in the whole AOP thing, this is how it worked for me: * install AJDT to your eclipse * convert Java project to AspectJ project * copy- paste the Aspect code from with this tutorial: mathewjhall.wordpress.com/2011/03/31/… * Run project

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.