String operations are heavy, so to avoid expensive concatenation operations in log messages, it is always preferred to check log level before logging.
So, lets say if we need to log message at debug level one should check for log.isDebugEnabled() first. This way we can avoid calculating log string if that particular log level is not enabled.
No need to check for error logs as error is the base log level.
String operations are heavy, so to avoid expensive concatenation operations in log messages, it is always preferred to check log level before logging. So, lets say if we need to log message at debug level one should check for log.isDebugEnabled() first. This way we can avoid calculating log string if that particular log level is not enabled. No need to check for error logs as error is the base log level.