0
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.annotations.Version  - Hibernate Annotations 3.3.1.GA
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Environment  - Hibernate 3.2.5
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Environment  - hibernate.properties not found
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Environment  - Bytecode provider name : cglib
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Environment  - using JDK 1.4 java.sql.Timestamp handling
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Configuration  - configuring from resource: hibernateMYSQL.cfg.xml
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.Configuration  - Configuration resource: hibernateMYSQL.cfg.xml
[http-apr-8080-exec-1] DEBUG org.hibernate.util.DTDEntityResolver  - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
[http-apr-8080-exec-1] DEBUG org.hibernate.util.DTDEntityResolver  - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
[http-apr-8080-exec-1] DEBUG org.hibernate.util.DTDEntityResolver  - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - dialect=org.hibernate.dialect.MySQLDialect
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.connection.driver_class=com.mysql.jdbc.Driver
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - current_session_context_class=thread
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - show_sql=false
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.acquire_increment=1
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.idle_test_period=300
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.timeout=28800
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.max_size=25
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.min_size=1
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.max_statement=0
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.Configuration  - hibernate.c3p0.preferredTestQuery=select 1;
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.AnnotationConfiguration  - null<-org.dom4j.tree.DefaultAttribute@72bdc0 [Attribute: name class value 
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - JDBC batch size: 15
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - JDBC batch updates for versioned data: disabled
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Scrollable result sets: enabled
[http-apr-8080-exec-1] DEBUG org.hibernate.cfg.SettingsFactory  - Wrap result sets: disabled
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - JDBC3 getGeneratedKeys(): enabled
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Connection release mode: auto
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Maximum outer join fetch depth: 2
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Default batch fetch size: 1
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Generate SQL with comments: disabled
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Order SQL updates by primary key: disabled
[http-apr-8080-exec-1] INFO  org.hibernate.cfg.SettingsFactory  - Order SQL inserts for batching: disabled

In my project i have

 log4j-1.2.15.jar
 slf4j-api-1.5.6.jar
 slf4j-log4j12-1.5.6
 slf4j-simple-1.4.3

Here is my log4j.properties file

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=${catalina.base}/logs/project/project.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=3
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=ERROR

And also added below code into hibernate.prperties file

hibernate.show_sql = false

But still getting huge amount of console output for every database operation in hibernate. How can i turn off these log message?

Shakib_007
  • 51
  • 1
  • 5
  • Possible duplicate of [Turning off hibernate logging console output](https://stackoverflow.com/questions/311408/turning-off-hibernate-logging-console-output) – Sam Jan 15 '18 at 06:55

1 Answers1

0

you can control the log level for hibernate's package from log4j's property file:

# basic log level for all messages
log4j.logger.org.hibernate=ERROR

Edit: post your "hibernateMYSQL.cfg.xml" - looks like that is the config file it is using

suvartheec
  • 3,484
  • 1
  • 17
  • 21
  • Try to find out who is logging. log4j or someone else. then ensure they use your config and appenders you define and not from somewhere else. then limit the log level of the appender. you would have to inspect the logs to understand.. – suvartheec Jan 15 '18 at 07:11
  • Is there any problem with jars? – Shakib_007 Jan 15 '18 at 07:14
  • Its a configuration issue. The logs have DEBUG statements, but the config that you have posted dont have that. the default log level is not debug. So it is getting configuration from somewhere else. Since you already have debug logs, they should contain statements of which config file was loaded. So you can check that. – suvartheec Jan 15 '18 at 11:46