<p><em>(see <a href="https://stackoverflow.com/questions/53316/hibernate-crops-clob-values-oddly">here</a> for the problem I'm trying to solve)</em></p>

<p>How do you get hibernate to log clob values it's going to insert. It is logging other value types, such as Integer etc.</p>

<p>I have the following in my log4j config:</p>

<pre><code>log4j.logger.net.sf.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.net.sf.hibernate.type=DEBUG
log4j.logger.org.hibernate.type=DEBUG
</code></pre>

<p>Which produces output such as:</p>

<pre><code>(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '0' to parameter: 2
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '1' to parameter: 2
</code></pre>

<p>However you'll note that it never displays <code>parameter: 3</code> which is our clob.</p>

<p>What I would really want is something like:</p>

<pre><code>(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '0' to parameter: 2
(org.hibernate.type.ClobType) binding 'something' to parameter: 3
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '1' to parameter: 2
(org.hibernate.type.ClobType) binding 'something else' to parameter: 3
</code></pre>

<p>How do I get it to show this in the log?</p>

[{'answer_id': 53419, 'author': 'Marcio Aguiar', 'author_id': 4213, 'author_profile': 'https://Stackoverflow.com/users/4213', 'pm_score': 2, 'selected': True, 'text': "<p>Try using:</p>\n\n<pre><code>log4j.logger.net.sf.hibernate=DEBUG\nlog4j.logger.org.hibernate=DEBUG\n</code></pre>\n\n<p>That's the finest level you'll get. If it does not show the information you want, then it's not possible.</p>\n"}, {'answer_id': 55810, 'author': 'SCdF', 'author_id': 1666, 'author_profile': 'https://Stackoverflow.com/users/1666', 'pm_score': 1, 'selected': False, 'text': '<p>Well, it looks like you can\'t. <em>(Thanks <a href="https://stackoverflow.com/questions/53365/getting-hibernate-to-log-clob-parameters#53419">Marcio</a> for the suggestion, but sadly that didn\'t add anything useful)</em></p>\n'}, {'answer_id': 61728, 'author': 'talg', 'author_id': 3332, 'author_profile': 'https://Stackoverflow.com/users/3332', 'pm_score': 0, 'selected': False, 'text': '<p>Try to set log4j.logger.org.hibernate.type=TRACE and see if that helps.</p>\n'}]
['https://Stackoverflow.com/questions/53365', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1666/']