"
log4j.properties
#log4j.rootLogger = [ level ] , appenderName, appenderName, ... log4j.rootLogger = INFO, console, R #level=INFO,all can be output #console is set to be a ConsoleAppender log4j.appender.console = org.apache.log4j.ConsoleAppender #console have four patterns #org.apache.log4j.HTMLLayout #org.apache.log4j.PatternLayout #org.apache.log4j.SimpleLayout #org.apache.log4j.TTCCLayout log4j.appender.console.layout = org.apache.log4j.PatternLayout #define the output type log4j.appender.console.layout.ConversionPattern = %-d{yyyy-MM-dd HH����ss} [%c]-[%p] %m%n #file is set to output to a extra file log4j.appender.R = org.apache.log4j.RollingFileAppender #the absolute route of the log4j file log4j.appender.R.File = ${webapp.root}/WEB-INF/logs/gzsfpy.log #the size log4j.appender.R.MaxFileSize = 500KB #back up a file log4j.appender.R.MaxBackupIndex = 1 log4j.appender.R.layout = org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%-d{yyyy-MM-dd HH\:mm\:ss} [%c]-[%p] - %m%n #druid\u65E5\u5FD7 log4j.logger.druid.sql=debug,stdout,infologspring关节镜配置
<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="${jdbc_url}"></property> <property name="username" value="${jdbc_username}"></property> <property name="password" value="${jdbc_password}"></property> <property name="maxActive" value="20" /> <property name="initialSize" value="1" /> <property name="maxWait" value="60000" /> <property name="minIdle" value="1" /> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="50" /> <property name="filters" value="stat" /> <property name="timeBetweenLogStatsMillis" value="300000" /> <!-- 监控数据库 --> <property name="proxyFilters"> <list> <ref bean="stat-filter" /> <ref bean="wall-filter" /> <ref bean="log-filter" /> </list> </property> </bean> <bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter"> <property name="slowSqlMillis" value="3000" /> <property name="logSlowSql" value="true" /> <property name="mergeSql" value="true" /> </bean> <bean id="log-filter" class="com.alibaba.druid.filter.logging.Log4jFilter"> <property name="resultSetLogEnabled" value="false" /> <property name="statementExecutableSqlLogEnable" value="true" /> </bean> <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter"> <property name="dbType" value="mysql" /> </bean>
java.lang.NullPointerException
at com.alibaba.druid.pool.DruidDataSource.getStatValueAndReset(DruidDataSource.java:1572)空指针,日志给全######<bean id="dataSource"class="com.alibaba.druid.pool.DruidDataSource" init-method="init"destroy-method="close"> 那个name该改成id吧######这就是报错的全部信息
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。