In c, printf()
is really easy to use, and in Java System.out.printf()
is also amazing, but in log4j
, seems only can use "First name: "+ firstName +", Age: " + age
, which is very uncomfortable.
The questions are:
log4j
from implement such a feature?You can use org.slf4j.Logger
which provides a way to format log
in such manner.
For example,
LOGGER.info("Roll number of Student {} is {}.", studentName, rollNumber);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With