logback怎么异步日志到oracle数据库中
1个回答
展开全部
正确配置应该是
<!-- 将日志存储到oracle数据库中 -->
<appender name="db-classic-oracle" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
<driverClass>oracle.jdbc.driver.OracleDriver</driverClass>
<url>jdbc:oracle:thin:@localhost:1521:ZYD</url>
<user>scott</user>
<password>tiger</password>
<sqlDialect class="ch.qos.logback.core.db.dialect.OracleDialect" />
</dataSource>
</connectionSource>
<sqlDialect class="ch.qos.logback.core.db.dialect.OracleDialect" />
</appender>
<!-- 将日志存储到oracle数据库中 -->
<appender name="db-classic-oracle" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
<driverClass>oracle.jdbc.driver.OracleDriver</driverClass>
<url>jdbc:oracle:thin:@localhost:1521:ZYD</url>
<user>scott</user>
<password>tiger</password>
<sqlDialect class="ch.qos.logback.core.db.dialect.OracleDialect" />
</dataSource>
</connectionSource>
<sqlDialect class="ch.qos.logback.core.db.dialect.OracleDialect" />
</appender>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询