我试图记录一个异常,并希望在日志消息中包含另一个变量的值.是否有Logger API可以做到这一点?
logger.error("Logging in user {} with birthday {}", user.getName(), user.getBirthdayCalendar(), exception);
java logging log4j exception
exception ×1
java ×1
log4j ×1
logging ×1