4

this is example of how sql is showed when using show_sql=true

Hibernate:
    select
        propertyse0_.entity_name as entity1_3_0_,
        propertyse0_.entity_id as entity2_3_0_,
        propertyse0_.entity_key as entity3_3_0_,
        propertyse0_.key_type as key4_3_0_,
        propertyse0_.boolean_val as boolean5_3_0_,
        propertyse0_.double_val as double6_3_0_,
        propertyse0_.string_val as string7_3_0_,
        propertyse0_.long_val as long8_3_0_,
        propertyse0_.int_val as int9_3_0_,
        propertyse0_.date_val as date10_3_0_
    from
        OS_PROPERTYENTRY propertyse0_
    where
        propertyse0_.entity_name=?
        and propertyse0_.entity_id=?
        and propertyse0_.entity_key=?

possible to show value to gather with the sql rather than '?'

3 Answers 3

2

Set your logging leven to "TRACE". In your log4j.properties (assuming your using Log4J):

log4j.logger.org.hibernate=TRACE

Will result in lots of logging tough...

Sign up to request clarification or add additional context in comments.

Comments

2

You need to set up your logging framework to log this level of details. See here for the various loggers that Hibernate uses, and how to use them.

The particular one that you want is:

  • org.hibernate.type - Log all JDBC parameters

Comments

0

not directly. you can use log4jdbc to log all the data that is sent over jdbc. It has a logger that inlines the prepared statement values.

2 Comments

can elaborate more how to integrate with spring+hibernate existing app
I created a proxy for my datasource in spring that added the logger spy of log4jdbc. And I have to admit that this is not done in 10 minutes. However, for my purpose it was worth the effort. But I just included it for my tests and not in the app server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.