5

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.

Simulant
  • 19,190
  • 8
  • 63
  • 98
user1808932
  • 427
  • 1
  • 5
  • 14

1 Answers1

2

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?

Community
  • 1
  • 1
Vicki
  • 668
  • 7
  • 21