Mybatis3.5.0 + log4j-1.2.17 報(bào)錯(cuò) StatusLogger No Log4j 2 configuration file found
Mybatis3.5.0 + log4j-1.2.17 報(bào)錯(cuò) StatusLogger No Log4j 2 configuration file found
無(wú)法生成日志
網(wǎng)上查了之后,似乎 不再支持properties文件了,要在項(xiàng)目的"src"下,新建一個(gè)log4j2.xml
實(shí)例:
<?xml?version="1.0"?encoding="UTF-8"?><Configuration> <Appenders> <Console?name="Console"?target="SYSTEM_OUT"> <PatternLayout?pattern="%d{HH:mm:ss.SSS}?[%t]?%-5level?%logger{36}?-?%msg%n"?/> </Console> </Appenders> <Loggers> <Root?level="debug"> <AppenderRef?ref="Console"?/> </Root> </Loggers></Configuration>
2020-03-07
Mybatis3.5版本以及集成了控制臺(tái)log的功能,不再需要引入log4j
只需要在Configuration.xml中添加如下設(shè)置即可開啟sql查詢?nèi)罩镜妮敵觯?/p>
2019-03-18
嘗試將Mybatis和log4j的版本降低一下,有的高版本會(huì)有些問題。