-->
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.  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Bind sql statement parameters with log4j.xml
PostPosted: Tue Nov 09, 2010 4:39 pm 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Hi,

I have a log4j.properties file which allows me to display in the log, the bound statement parameters.

But when I switch to using a log4j.xml file then only the statements, but not their bound parameters, are displayed.

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

# Root logger option
log4j.rootLogger=INFO, stdout

# Hibernate logging options (INFO only shows startup messages)
log4j.logger.org.hibernate=ERROR

# Log JDBC bind parameter runtime arguments
log4j.logger.org.hibernate.type=TRACE


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="INFO" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>
 
   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <root>
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>


I also tried this but it did not change anything:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="INFO" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <category name="org.hibernate.SQL" additivity="false">
      <priority value="debug" />
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </category>

   <category name="org.hibernate.type" additivity="false">
      <priority value="debug" />
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </category>

   <root>
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>

I Google my day away..


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Nov 09, 2010 4:55 pm 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Here is the spring-hibernate.xml configuration file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
   <bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource">
         <ref bean="dataSource" />
      </property>
      <property name="mappingDirectoryLocations">
         <list>
            <value>classpath:com/thalasoft/learnintouch/core/service</value>
            <value>classpath:com/thalasoft/learnintouch/core/domain</value>
         </list>
      </property>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">true</prop>
            <prop key="hibernate.connection.pool_size">0</prop>
            <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
         </props>
      </property>
   </bean>

   <bean id="transactionManager"
      class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory">
         <ref local="sessionFactory" />
      </property>
   </bean>

   <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
      <property name="sessionFactory">
         <ref bean="sessionFactory" />
      </property>
   </bean>

   <bean
      class="org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor" />

</beans>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Nov 09, 2010 5:04 pm 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Now I finaly found the way to see the bound statement parameters.

Here is the working file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="INFO" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <appender name="sqlAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="TRACE" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <category name="org.hibernate.SQL" additivity="false">
      <priority value="TRACE" />
      <appender-ref ref="sqlAppender" />
   </category>

   <category name="org.hibernate.type" additivity="false">
      <priority value="TRACE" />
      <appender-ref ref="sqlAppender" />
   </category>

   <root>
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>


The remaining problem is that the Hibernate statements are displayed twice, in the log.


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Wed Nov 10, 2010 9:23 am 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
Disable log4j additivity for needed packages.


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Wed Nov 10, 2010 9:48 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
I wish I knew what you meant :-)


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Wed Nov 10, 2010 10:26 am 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
http://veerasundar.com/blog/2009/08/log ... t-and-why/


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Wed Nov 10, 2010 10:29 am 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
Hm... I just noticed that your additivity setting seem to be correct.

Just remove console appender from your root logger. You already have the same data written by your "sqlAppender".

That is change the following code:

Code:
    <root>
      <appender-ref ref="consoleAppender" />
      <appender-ref ref="fileAppender" />
   </root>


To following:

Code:
    <root>
      <appender-ref ref="fileAppender" />
   </root>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Nov 30, 2010 10:14 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
I just upgraded to Hibernate 3.6.0.Final and I don't know if it's related but the statement parameters are not logged any longer.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="DEBUG" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <category name="org.springframework" additivity="false">
      <appender-ref ref="consoleAppender" />
   </category>

   <category name="com.thalasoft" additivity="false">
      <appender-ref ref="consoleAppender" />
   </category>

   <appender name="sqlAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="TRACE" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <category name="org.hibernate.SQL" additivity="false">
      <appender-ref ref="sqlAppender" />
   </category>

   <category name="org.hibernate.type" additivity="false">
      <appender-ref ref="sqlAppender" />
   </category>

   <root>
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>


I suspect that org.hibernate.SQL and org.hibernate.type are not triggering the sqlAppender any longer...


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Nov 30, 2010 10:27 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
So I started trimming down the log4j.xml file and the logging was indeed reduced.

But the strange thing was that the logging of all sql statements remained the exact same.

You can see that the trimmed file does not contain any sqlAppender any longer:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="DEBUG" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <root>
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>


And still, the logging of the sql statements keeps on:

Quote:
Hibernate:
insert
into
content_import
(version, domain_name, is_importing, is_exporting, id)
values
(?, ?, ?, ?, null)
Hibernate:
call identity()
Hibernate:
select
this_.id as id99_0_,
this_.version as version99_0_,
this_.domain_name as domain3_99_0_,
this_.is_importing as is4_99_0_,
this_.is_exporting as is5_99_0_,
this_.permission_key as permission6_99_0_,
this_.permission_status as permission7_99_0_
from
content_import this_
where
this_.domain_name=?
and this_.is_importing=?
order by
this_.domain_name asc
Hibernate:
insert
into
content_import
(version, domain_name, is_importing, is_exporting, id)
values
(?, ?, ?, ?, null)
Hibernate:
call identity()
Hibernate:
insert
into
content_import
(version, domain_name, is_importing, is_exporting, id)
values
(?, ?, ?, ?, null)
Hibernate:
call identity()
Hibernate:
select
this_.id as id99_0_,
this_.version as version99_0_,
this_.domain_name as domain3_99_0_,
this_.is_importing as is4_99_0_,
this_.is_exporting as is5_99_0_,
this_.permission_key as permission6_99_0_,
this_.permission_status as permission7_99_0_
from
content_import this_
where
this_.domain_name=?
and this_.is_exporting=?
order by
this_.domain_name asc
Hibernate:
select
this_.id as id99_0_,
this_.version as version99_0_,
this_.domain_name as domain3_99_0_,
this_.is_importing as is4_99_0_,
this_.is_exporting as is5_99_0_,
this_.permission_key as permission6_99_0_,
this_.permission_status as permission7_99_0_
from
content_import this_
where
this_.domain_name=?
and this_.is_exporting=?
order by
this_.domain_name asc


Where does this sql statements logging come from ?

Is there any logging default value or behavior with Hibernate 3.6.0.Final ?


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Mon Dec 13, 2010 7:32 pm 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Anyone ?


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Dec 14, 2010 5:13 am 
Beginner
Beginner

Joined: Fri Nov 14, 2008 7:34 pm
Posts: 24
<category name="org.hibernate.type">
<priority value="TRACE"/>
</category>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Dec 14, 2010 5:50 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
I tried
Code:
   <category name="org.hibernate.SQL" additivity="false">
      <appender-ref ref="sqlAppender" />
      <priority value="TRACE" />
   </category>

   <category name="org.hibernate.type" additivity="false">
      <appender-ref ref="sqlAppender" />
      <priority value="TRACE" />
   </category>


I tried
Code:
   <category name="org.hibernate.SQL" additivity="false">
      <appender-ref ref="sqlAppender" />
   </category>

   <category name="org.hibernate.type">
      <priority value="TRACE" />
   </category>


No luck.

I thing to note, is that the TRACE level is already specified in:
Code:
   <appender name="sqlAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="TRACE" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Tue Dec 14, 2010 5:55 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
As a reminder, here is the content of the log4j.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   debug="false">

   <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="DEBUG" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
      <param name="Threshold" value="INFO" />
      <param name="File" value="build.log" />
      <param name="maxFileSize" value="100KB" />
      <param name="maxBackupIndex" value="5" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <appender name="mailAppender" class="org.apache.log4j.net.SMTPAppender">
      <param name="SMTPHost" value="smtp.free.fr" />
      <param name="From" value="stephane@thalasoft.com" />
      <param name="To" value="stephane@thalasoft.com" />
      <param name="Subject" value="[LOG] Java - learnintouch " />
      <param name="BufferSize" value="100" />
      <param name="Threshold" value="ERROR" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
         <param name="LevelMin" value="DEBUG" />
         <param name="LevelMax" value="FATAL" />
      </filter>
   </appender>

   <category name="org.springframework" additivity="false">
      <appender-ref ref="consoleAppender" />
   </category>

   <category name="com.thalasoft" additivity="false">
      <appender-ref ref="consoleAppender" />
   </category>

   <appender name="sqlAppender" class="org.apache.log4j.ConsoleAppender">
      <param name="Threshold" value="TRACE" />
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p  [%c{1}] %m %n" />
      </layout>
   </appender>

   <category name="org.hibernate.SQL" additivity="false">
      <appender-ref ref="sqlAppender" />
   </category>

   <category name="org.hibernate.type" additivity="false">
      <appender-ref ref="sqlAppender" />
   </category>

   <root>
      <appender-ref ref="fileAppender" />
   </root>

</log4j:configuration>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Sun Dec 26, 2010 6:36 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
My Spring Hibernate configuration:
Code:
   <bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource">
         <ref bean="dataSource" />
      </property>
      <property name="mappingDirectoryLocations">
         <list>
            <value>classpath:com/thalasoft/learnintouch/core/domain</value>
         </list>
      </property>
      <property name="mappingResources">
         <list>
            <value>com/thalasoft/learnintouch/core/domain/typedef.hbm.xml
            </value>
         </list>
      </property>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
            <prop key="hibernate.connection.pool_size">0</prop>
            <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">true</prop>
         </props>
      </property>
   </bean>


Top
 Profile  
 
 Post subject: Re: Bind sql statement parameters with log4j.xml
PostPosted: Sun Dec 26, 2010 6:37 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
My pom.xml file:
Code:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.thalasoft</groupId>
   <artifactId>learnintouch</artifactId>
   <packaging>pom</packaging>
   <version>1.0-SNAPSHOT</version>
   <name>learnintouch</name>
   <url>http://www.thalasoft.com</url>
   <modules>
      <module>core</module>
   </modules>
   <properties>
      <spring.core.version>2.5.6</spring.core.version>
      <hibernate.version>3.6.0.Final</hibernate.version>
      <test.source.dir>src/test/java</test.source.dir>
   </properties>
   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.6</source>
               <target>1.6</target>
               <encoding>UTF-8</encoding>
            </configuration>
         </plugin>
      </plugins>
    <testSourceDirectory>
      ${test.source.dir}
    </testSourceDirectory>
   </build>
  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
      </properties>
      <build>
        <filters>
          <filter>src/main/filters/data-source.properties</filter>
        </filters>
        <resources>
        <resource>
          <directory>src/main/resources</directory>
          <filtering>true</filtering>
        </resource>
        </resources>
      </build>
    </profile>
    <profile>
      <id>integration-test</id>
      <properties>
        <test.source.dir>src/integration/java</test.source.dir>
      </properties>
      <build>
        <filters>
          <filter>src/integration/filters/data-source.properties</filter>
        </filters>
        <resources>
        <resource>
          <directory>src/integration/resources</directory>
          <filtering>true</filtering>
        </resource>
        </resources>
      </build>
    </profile>
    <profile>
      <id>mysql-test</id>
      <properties>
        <test.source.dir>src/integration/java</test.source.dir>
      </properties>
      <build>
        <filters>
          <filter>src/main/filters/data-source.properties</filter>
        </filters>
        <resources>
        <resource>
          <directory>src/integration/resources</directory>
          <filtering>true</filtering>
        </resource>
        </resources>
      </build>
    </profile>
  </profiles>
   <repositories>
      <repository>
         <id>JBoss repository</id>
         <url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
      </repository>
      <repository>
         <id>Usertype</id>
         <url>http://repo1.maven.org/maven2/org/jadira</url>
      </repository>
   </repositories>
   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
            <scope>test</scope>
         </dependency>
         <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
         </dependency>
       <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
      </dependency>
         <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>1.6</version>
         </dependency>
      <dependency>
        <groupId>org.jadira.usertype</groupId>
        <artifactId>usertype.jodatime</artifactId>
            <version>1.7</version>
         </dependency>
         <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
         </dependency>
         <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jasypt</groupId>
        <artifactId>jasypt</artifactId>
        <version>1.7</version>
      </dependency>
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.12</version>
      </dependency>
         <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.8-brew</version>
            <scope>test</scope>
         </dependency>
         <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>${spring.core.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.core.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.core.version}</version>
         </dependency>
      </dependencies>
   </dependencyManagement>
</project>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 28 posts ]  Go to page 1, 2  Next

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.