cancel
Showing results for 
Search instead for 
Did you mean: 

Logging level recommendation

pandeysuresh06
Participant
0 Kudos

What is recommended

Logger.debug ("this is a debugging information")

if(LOGGER.isDebugEnabled()){ Logger.debug ("this is a debugging information") }

I am talking from the performance point of view . Would love your inputs on these.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member224482
Active Contributor
0 Kudos

if statements are not required anymore as slf4j has optimized this scenario.

 Bad  : Logger.debug ("This is a debugging information on object='" + object+ "'");
 Good : Logger.debug ("This is a debugging information on object='{}'", object);

Ensure to follow the good pattern to avoid unnecessary string concatenations.

Reference : http://slf4j.org/faq.html