报错:
ERROR StatusLogger NoSql contains an invalid element or attribute "MongoDb"
ERROR StatusLogger NoSQL provider not specified for appender [databaseAppender].
ERROR StatusLogger Null object returned for NoSql in Appenders.
ERROR StatusLogger Unable to locate appender "databaseAppender" for logger config "mongoLog"
原因:
测试项目中并用到MongoDb,而log4j2.xml配置了MongoDb。导致报错。
解决方法:删除或注释掉即可。
(搜:databaseAppender 有两处。)
<!-- <!–输出到MongoDB中–>
<NoSql name="databaseAppender">
<MongoDb databaseName="test" collectionName="errorlog" server="localhost" port="27017"/>
</NoSql>-->
<!--输出到NoSQL中-->
<!-- <Logger name="mongoLog" level="trace" additivity="false">
<AppenderRef ref="databaseAppender"/>
</Logger>-->
标签:StatusLogger,NoSql,attribute,contains,ERROR,MongoDb From: https://www.cnblogs.com/liuguiqing/p/18425220