Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log enter and exit of function flow in Java [closed]

Tags:

java

logging

I'm new to Java, I have to log enter and exit of function flow, it's quite easy doing it in C++, but I don't know how to do it in Java.
Any input will be appreciated.

like image 502
user1808932 Avatar asked Nov 04 '22 11:11

user1808932


1 Answers

There are several logging libraries (log4J http://logging.apache.org/log4j/1.2/ being a commonly used one) and slf4J http://www.slf4j.org/ being particularly useful as it is library agnostic.

If you want to log every function entry/exit you could look at AspectJ/AOP as mentioned in this post How to use AOP with AspectJ for logging?

like image 99
Vicki Avatar answered Nov 12 '22 15:11

Vicki