HikariCP-如何使用dataSource.logWriter

时间:2019-01-22 06:19:24

标签: java logging hikaricp

HikariCP Github page具有以下代码:

props.put("dataSource.logWriter", new PrintWriter(System.out));

但是由于不支持LogWriter,所以出现NullPointerException,

DriverDataSource最后的HikariCP类:

@Override
public PrintWriter getLogWriter() throws SQLException
{
   throw new SQLFeatureNotSupportedException();
}

@Override
public void setLogWriter(PrintWriter logWriter) throws SQLException
{
   throw new SQLFeatureNotSupportedException();
}

此更新HikariCP日志记录的解决方案不相关吗?

group中我没有得到任何答案

编辑

Hikari初始化代码使用PoolBase,它使用DriverDataSource(不支持logWriter)初始化数据源:

else if (jdbcUrl != null && ds == null) {
     ds = new DriverDataSource(jdbcUrl, driverClassName, dataSourceProperties, username, password);

我必须在Oracle中发送jdbcUrl,并且setDataSourceClassNamesetDriverClassName一起失败

0 个答案:

没有答案