What is the best way to display the following details in org.slf4j.Logger
logger.info(problemCount + " problem entries deleted for the Object: " + id );
This is info, I want to display these finer details for a while to help with issues by looking at the logs.
I know there are some references that says built-in string formatting should be used instead of string concatenation like the following
logger.info(String.format("%d problem entries deleted for the Object: %s ",problemCount, id));
Is there an efficient way to write these kinds of log statements in java using org.slf4j.Logger?
Refer the link below as to why answer is preferred based on efficiency and performance.
Logger slf4j advantages of formatting with {} instead of string concatenation