1. 开启
添加成员
private static final Logger LOGGER = LoggerFactory.getLogger(XxxController.class);
2.使用
LOGGER.info("before param is {}",param);
...
LOGGER.info("after param is {}",param);
注释:
不用添加依赖,spingboot 自带。
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;