Through log4j, the log information is not only printed to the console, but also output to the specified file, according to the configuration information;
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
1. startup
//自动快速地使用缺省Log4j环境
BasicConfigurator.configure();
//日志记录器
private static Logger LOGGER = LogManager.getLogger(Xx.class);
log level:
LOGGER.info LOGGER.warn LOGGER.error LOGGER.debug