Announcement Announcement Module
Collapse
No announcement yet.
Problem getting sql parameter values with log4j Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem getting sql parameter values with log4j

    I am using:
    - Spring 3.0.1
    - Log4j 1.12.15
    - Oracle 10j

    I need to see the values that my Spring application is sending to Oracle, but all I see are the prepared statements, such as:

    Hibernate: insert into Event (EVENT_DATE, DESCRIPTION, FIRST_NAME, LAST_NAME, EVENT_TYPE, USER_ID, PARENT_ID, PARENT_TYPE, ID) values ( ?, ?, ?, ?, ?, ?, ?, 'ACCOUNT', ?)

    I have tried to follow the advice in other threads, for log4j settings, as in this thread:

    http://forum.springsource.org/showthread.php?t=60406

    for org.hibernate.SQL and org.hibernate.type, and the hibernateProperties setting of show_sql=true, but I still don't get the binding parameters.

    Here is my log4j.properties:

    Code:
    log4j.rootLogger=TRACE, CONSOLE
    
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{MMM yyyy HH:mm:ss} %-4r [%t] %-5p %c %x - %m%n
    
    log4j.appender.stdout.org.hibernate.SQL=CONSOLE
    log4j.appender.stdout.org.hibernate=CONSOLE
    log4j.appender.stdout.org.hibernate.type=CONSOLE
    log4j.appender.stdout.net.sf.hibernate.type=CONSOLE
    log4j.appender.stdout.org.springframework=CONSOLE
    log4j.appender.stdout.org.springframework.security=CONSOLE
    log4j.appender.stdout.org.springsource=CONSOLE
    log4j.appender.stdout.org.apache.catalina.startup.Bootstrap=CONSOLE
    log4j.appender.stdout.com.icesoft=CONSOLE
    log4j.appender.stdout.org.apache.catalina=CONSOLE
    log4j.appender.stdout.org.apache.commons.digester=CONSOLE
    log4j.appender.stdout.org.apache.commons.modeler=CONSOLE
    log4j.additivity.org.hibernate.SQL=false
    log4j.additivity.net.sf.hibernate.type=false
    log4j.additivity.org.hibernate.type=false
    
    log4j.logger.org.hibernate.SQL=trace
    log4j.logger.org.hibernate=trace
    log4j.logger.org.hibernate.type=TRACE  
    log4j.logger.net.sf.hibernate.type=trace
    log4j.logger.org.springframework=DEBUG
    log4j.logger.org.springframework.security=DEBUG
    log4j.logger.org.springframework.security.web=INFO
    log4j.logger.org.springframework.beans=INFO
    log4j.logger.org.springsource=DEBUG
    log4j.logger.org.apache.catalina.startup.Bootstrap=DEBUG
    log4j.logger.com.icesoft=INFO
    log4j.logger.org.apache.catalina=INFO
    log4j.logger.org.apache.commons.digester=INFO
    log4j.logger.org.apache.commons.modeler=INFO
    And a portion my my spring context file:

    Code:
    	<bean id="sessionFactory"
    		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
    				<prop key="hibernate.show_sql">true</prop>
    				<prop key="log4j.logger.net.sf.hibernate">trace</prop>
    			</props>
    		</property>
    		<property name="lobHandler" ref="defaultLobHandler"></property>
    		<property name="eventListeners">
    			<map>
    				<entry key="merge">
    					<bean
    						class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener" />
    				</entry>
    			</map>
    		</property>
    	</bean>
Working...
X