0

I am working on a project that enhances the operability of my application by going through all the application logic and decide what to log and what level where to use. I am stuck between the usage of TRACE and DEBUG. For example in a method:

public void search(String text) {
   log.trace("Inside search() method");
   log.info("search text value:{}", text);
   ...
}

Is this the correct approach for logging?

Java2Avaj
  • 23
  • 4
  • 1
    generally, for info, its something that NEED TO KNOW, so that when looking over a log you can probably trace the execution of your program from a "larger" perspective. Then debug would be finer grained so that you can look at the values etc as it is being processed. Then trace would be even finer grained where you can even see how it enters/exits a method. Though this is kinda subjective, and up to you – experiment unit 1998X Apr 14 '23 at 05:54

0 Answers0