Hibernate version: 3
Name and version of the database you are using:db2 8
The generated SQL (show_sql=true): true
Debug level Hibernate log excerpt:debug
Hi,
I have configured log4j with hibernate and still i get all the hibernate messages on console and is not being logged to the log file configured.
The messages sent by my application is only logged in my log file. How do i include all the messages of hibernate and SQL (displayed on console with the param show_sql=true) to my created file.
Is there a way to get the actual binded parameters insted of '?" with SQL statements
1. Log4j jar has been included.
2. log4j.properties is in classpath
3. Contents of log4j
-----------------------------------
log4j.appender.fileapp=org.apache.log4j.FileAppender
log4j.appender.fileapp.File=/home/xxxx/Libra/Libra_TSVWriter_Logs.txt
log4j.appender.fileapp.layout=org.apache.log4j.PatternLayout
log4j.appender.fileapp.layout.ConversionPattern=%d{ISO8601}|%p|%F|%M|%L|%m%n
log4j.rootLogger=debug, fileapp
log4j.logger.org.hibernate=debug
4. hibernate.cfg.xml
--------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="connection.username">uid</property>
<property name="connection.password">pass</property>
<property name="connection.driver_class">
com.ibm.db2.jcc.DB2Driver
</property>
<property name="connection.url">
jdbc:db2://xxxxx:xxxx/xxxx
</property>
<mapping resource="com/xxxx/libra/or/LibraHcAssess.hbm.xml"></mapping>
<mapping resource="com/xxxx/libra/or/LibraProcessMast.hbm.xml"></mapping>
</session-factory>
</hibernate-configuration>
5.Startup messages
------------------------------
May 29, 2008 1:57:17 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.6
May 29, 2008 1:57:18 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 29, 2008 1:57:18 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
May 29, 2008 1:57:18 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
May 29, 2008 1:57:18 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
May 29, 2008 1:57:18 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
May 29, 2008 1:57:19 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : com/xxxx/libra/or/LibraHcAssess.hbm.xml
May 29, 2008 1:57:19 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.xxxx.libra.or.LibraHcAssess -> LIBRA_HC_ASSESS
May 29, 2008 1:57:19 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : com/xxxx/libra/or/LibraProcessMast.hbm.xml
May 29, 2008 1:57:19 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.xxxx.libra.or.LibraProcessMast -> LIBRA_PROCESS_MAST
May 29, 2008 1:57:19 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
May 29, 2008 1:57:19 PM org.hibernate.cfg.HbmBinder bindCollectionSecondPass
INFO: Mapping collection: com.xxxx.libra.or.LibraProcessMast.setDBTableLibraHcAssess -> LIBRA_HC_ASSESS
May 29, 2008 1:57:19 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
May 29, 2008 1:57:19 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
May 29, 2008 1:57:19 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
May 29, 2008 1:57:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.ibm.db2.jcc.DB2Driver at URL: jdbc:db2://ptulb015:60060/PIGTSINI
May 29, 2008 1:57:20 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=nycikcp, password=****}
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: DB2/SUN64, version: SQL08026
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: IBM DB2 JDBC Universal Driver Architecture, version: 2.9.31
May 29, 2008 1:57:21 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.DB2Dialect
May 29, 2008 1:57:21 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
May 29, 2008 1:57:21 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
May 29, 2008 1:57:21 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
May 29, 2008 1:57:21 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
May 29, 2008 1:57:21 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
May 29, 2008 1:57:21 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
|