The issue comes in if ${Message} is a build up string, using something like String.format(...) or MessageFormat.format(..), since that will get called before the parameter gets passed to logger.debug(...), thus doing something that might not be necessary to execute if debug logging is not enabled.
And in a lot of applications, every millisecond counts.
it's cheaper to skip evalution of an expensive log statement.
姚博文 logger.isDebugEnabled()
最新推荐文章于 2022-04-19 09:09:16 发布