logback怎么异步日志到oracle数据库中
1个回答
展开全部
配置一个appender就可以了。
<appender>
<appender name="DatabaseAppender" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<driverClass>oracle.jdbc.OracleDriver</driverClass>
<url>jdbc:oracle:thin:@HOST_URL:PORT:SERVICE_NAME</url>
<user>USER</user>
<password>PASS</password>
</connectionSource>
</appender>
<appender>
<appender name="DatabaseAppender" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<driverClass>oracle.jdbc.OracleDriver</driverClass>
<url>jdbc:oracle:thin:@HOST_URL:PORT:SERVICE_NAME</url>
<user>USER</user>
<password>PASS</password>
</connectionSource>
</appender>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询