I am trying to setup my own SqlStatementLogger, and it looks like that would require overriding JdbcServices service, but I am not finding a way to do that.
How can i configure my own JdbcServices service override?
Am I missing other (hopefully easier) way to replace SqlStatementLogger class?
I can’t see how registering my logger as a service could help, because JdbsServices class instantiates a new SqlStatementLogger without checking services, so logging classes which get the logger from the JdbcService will never get mine.
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.SqlStatementLogger.isFormat()" because "this.sqlStatementLogger" is null
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:277)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216)
...
Caused by: java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.SqlStatementLogger.isFormat()" because "this.sqlStatementLogger" is null
at org.hibernate.reactive.pool.impl.SqlClientConnection.feedback(SqlClientConnection.java:270)
at org.hibernate.reactive.pool.impl.SqlClientConnection.preparedQuery(SqlClientConnection.java:250)
at org.hibernate.reactive.pool.impl.SqlClientConnection.select(SqlClientConnection.java:113)
at org.hibernate.reactive.provider.service.NoJdbcEnvironmentInitiator$DialectBuilder.resolutionInfoStage(NoJdbcEnvironmentInitiator.java:105)
at org.hibernate.reactive.provider.service.NoJdbcEnvironmentInitiator$DialectBuilder.buildResolutionInfo(NoJdbcEnvironmentInitiator.java:83)
Just for completion, here is a document with a detailed explanation about how to add services in versions 5.3 and up: Hibernate ORM 5.3 Integration Guide