How to get JDBC binding parameters from Hibernate in JBoss 7?

前端 未结 1 954
北恋
北恋 2021-02-05 18:13

I\'m trying simply to get the values that Hibernate is binding to the queries behind the question marks \"?\" on JBoss 7.

So I\'m editing standalone/configuration/

1条回答
  •  [愿得一人]
    2021-02-05 18:21

    Wow, it's not really like the previous versions... I've finally found the offical way to configure JBoss 7 logging and the logging configuration of Hibernate 4 !

    What you have to do is edit standalone/configuration/standalone.xml (the configuration file of your domain) and search for the tag.

    Then in the , I've switched the level information to TRACE () and added the .

    Here is the partial XML :

    
        
            
            
                
            
        
        ...
        
            
        
        ...
    

    I've found another and better (because it logs all the JDBC method calls, not only basic binding) solution from a blog post: add spy="true" in the declaration and TRACE logs from category jboss.jdbc.spy:

    
    

    and the logger (in ):

    
        
    
    

    0 讨论(0)
提交回复
热议问题