-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate 4 JBoss AS 7.1.1 Log4j
PostPosted: Tue Feb 05, 2013 12:29 pm 
Newbie

Joined: Tue Feb 05, 2013 12:16 pm
Posts: 1
Hello, this is my first topic!! sorry for my bad English, I do not write very well. my question is how to display the parameters binding in the query sql????
I have a project with JPA in JBoss AS 7.1.1 and I have this in my persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
   xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
   <persistence-unit name="PruebaJBossJPAPU"
      transaction-type="JTA">
      <jta-data-source>java:/bdjpahibDS</jta-data-source>
      <properties>
         <property name="hibernate.show_sql" value="true" />
         <property name="hibernate.format_sql" value="true" />
         <property name="hibernate.use_sql_comments" value="true" />
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
      </properties>
   </persistence-unit>
</persistence>


I have in my log4j.properties (located in WEB-INF/classes) this:
Code:
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

log4j.rootLogger=debug, stdout
log4j.logger.org.hibernate=debug
log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.type=debug
log4j.logger.org.hibernate.tool.hbm2ddl=debug
log4j.logger.org.hibernate.jdbc=debug


also I have a jboss-deployment-structure.xml file in META-INF:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
   <deployment>
      <!-- Exclusions allow you to prevent the server from automatically adding
         some dependencies -->
      <exclusions>
         <module name="org.apache.log4j" />
      </exclusions>
   </deployment>
</jboss-deployment-structure>


and I have the following libraries in WEB-INF/lib:
log4j-1.2.16.jar
jcl-over-slf4j-1.7.1.jar
slf4j-api-1.7.1.jar
slf4j-log4j12-1.7.1.jar

but only shows the SQL query, no parameters displays.
Please appreciate any help. Thanks in advance!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.