Chris Popp (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-14139 (
https://hibernate.atlassian.net/browse/HHH-14139?atlOrigin=eyJpIjoiMTc2MD...
)
Re: BasicBinder Trace Logging Causes Duplicated Message (
https://hibernate.atlassian.net/browse/HHH-14139?atlOrigin=eyJpIjoiMTc2MD...
)
It was a Spring boot based project using spring start logging so the logging was a little
more complex than I anticipated but I created a simple reproduction.
* I created a simple maven project with these dependencies
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.19.Final</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.3</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.13.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
* And then ran this test class
public class LogTest {
public static void main(String[] args) throws Exception {
Logger root = (Logger)LoggerFactory.getLogger(BasicBinder.class);
root.setLevel(Level.TRACE);
BasicBinder basicBinder = new TestBinder();
basicBinder.bind(null, "{}", "someName", null);
}
private static class TestBinder extends BasicBinder {
public TestBinder() {
super(new StringTypeDescriptor(), new VarcharTypeDescriptor());
}
@Override
protected void doBind(CallableStatement st, Object value, String name, WrapperOptions
options) throws SQLException {
}
@Override
protected void doBind(PreparedStatement st, Object value, int index, WrapperOptions
options)throws SQLException {
}
}
}
* And saw the following when I ran it
20:44:06.561 [main] DEBUG org.jboss.logging - Logging Provider:
org.jboss.logging.Log4j2LoggerProvider
20:44:06.582 [main] TRACE org.hibernate.type.descriptor.sql.BasicBinder -
binding parameter [someName] as [VARCHAR] - [binding parameter [someName]
as [VARCHAR] - [{}]]
(
https://hibernate.atlassian.net/browse/HHH-14139#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14139#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100141- sha1:76df2fe )