[slf4j — user] How to prefix log messages for individual Loggers?

Cheav Sovannarith
Java Epic
Published in
1 min readJul 6, 2019

Hi there,

Slf4j Logger in Spring boot can be used by zero configuration. And how we set prefix to the logger by each class in something like below :

private static final Logger LOGGER = LoggerFactory.getClass(MyClass.class + “prefix”);

So when you try to log something, you will see your prefix of that class appear on the log file.

Hope you enjoy this tip 🙌 !

--

--