Is there any way that I can log / record / monitor / view every execution of a method inside of a Java program.
For example:
12:30:12 someMethod("argument")
12:30:12 anotherMethos(1, 2, 3)
12:30:13 finalMethod("invalidInputHere1234")
Easy answer: modify the method, and insert logging statements.
Somewhat more complex answer, which works even if you can't modify the method: look into aspect-based programming.
Without modifying the code you could use a debugger or profiler that is able to record any state change, like the Chronon time travelling debugger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With