com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> “The configuration file for resource identifier ‘/mchange-commons.properties’ could not be found. Skipping.”, exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> “The configuration file for resource identifier ‘/mchange-log.properties’ could not be found. Skipping.”, exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> “The configuration file for resource identifier ‘/c3p0.properties’ could not be found. Skipping.”, exception -> null]
怎么解决上面的警告
方法一: 加入找不到报警的文件
在resources文件下加mchange-log.properties配置文件里面内容为
com.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog
com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=OFF
方法二: 更换连接池
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="${user.dir}/logs"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] -| %-5level %logger{40}-%msg%n</Pattern>
</encoder>
</appender>
<!-- 错误日志 一天产生一个日志文件,且只保存最近30天的日志文件,如果当前文件超过10M就进行分割-->
<appender name="ERROR_FILE_DAILY_ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}//error.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] -| %-5level %logger{40} - %msg%n</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<maxHistory>30</maxHistory>
<fileNamePattern>${log.path}/error/%d.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
</rollingPolicy>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="DBAppender" class="ch.qos.logback.classic.db.DBAppender">
<!-- 使用druid连接池-->
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
<dataSource class="com.alibaba.druid.pool.DruidDataSource">
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<url>jdbc:mysql://47.101.xxx.xxx:3306/xy-pay-risk?autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=false</url>
<username>root</username>
<password>Xykjxxx</password>
<!-- 连接名称-->
<name>logback</name>
<!-- initialSize :初始化时获取三个连接,取值应在minIdle与maxIdle之间。 -->
<initialSize>3</initialSize>
<!-- minIdle、最小连接数 -->
<minIdle>1</minIdle>
<!-- maxIdle、最大连接数 -->
<maxIdle>10</maxIdle>
<!-- 最大并发连接-->
<maxActive>10</maxActive>
<!--maxWait:配置获取连接等待超时的时间 ,单位是毫秒-->
<maxWait>60000</maxWait>
<!--配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒-->
<timeBetweenEvictionRunsMillis>60000</timeBetweenEvictionRunsMillis>
<!-- 超过时间限制是否回收 -->
<removeAbandoned>true</removeAbandoned>
<!-- 连接泄漏回收参数,单位是秒 180秒,泄露的连接可以被删除的超时值 。180秒=3分钟 -->
<removeAbandonedTimeout>180</removeAbandonedTimeout>
</dataSource>
</connectionSource>
<!-- 使用c3p0连接池-->
<!-- <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">-->
<!-- <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">-->
<!-- <driverClass>com.mysql.jdbc.Driver</driverClass>-->
<!-- <jdbcUrl>jdbc:mysql://47.101.xxx.xxx:3306/xy-pay-risk?autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=false</jdbcUrl>-->
<!-- <user>root</user>-->
<!-- <password>Xykjxxx</password>-->
<!-- <!–initialPoolSize:初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。 –>-->
<!-- <initialPoolSize>3</initialPoolSize>-->
<!-- <!–minPoolSize 最小连接数–>-->
<!-- <minPoolSize>1</minPoolSize>-->
<!-- <!–maxPoolSize:连接池中保留的最大连接数。 –>-->
<!-- <maxPoolSize>10</maxPoolSize>-->
<!-- <!–maxIdleTime:最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。–>-->
<!-- <maxIdleTime>60</maxIdleTime>-->
<!-- <!–maxStatements:最大链接数。–>-->
<!-- <maxStatements>100</maxStatements>-->
<!-- <!–idleConnectionTestPeriod:每60秒检查所有连接池中的空闲连接。–>-->
<!-- <idleConnectionTestPeriod>60</idleConnectionTestPeriod>-->
<!-- </dataSource>-->
<!-- </connectionSource>-->
<filter class="com.xy.common.logback.LogLevelFilter">
<greaterThan>info</greaterThan>
</filter>
</appender>
<logger name="com.xy" level="warn"/>
<logger name="com.xy.pay.risk.web.listener.SpringStartListener" level="info" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="com.xy.pay.risk.web.listener.SpringStopListener" level="info" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<root>
<level value="error"/>
<appender-ref ref="ERROR_FILE_DAILY_ROLLING"/>
<appender-ref ref="DBAppender"/>
</root>
</configuration>