0
votes

My log4j.properties looks like

log4j.rootCategory=DEBUG, A1

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=InteroperabilityFatal.log
log4j.appender.A1.MaxFileSize=1000KB
log4j.appender.A1.MaxBackupIndex=1000
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%p %t %c - %m%n
log4j.appender.A1.Threshold=FATAL
log4j.appender.A1.Append=true
log4j.logger.org.hibernate=FATAL
log4j.logger.org.hibernate.sql=FATAL
log4j.logger.org.hibernate.hql=error

I want only fatal logs into the file and nothing in console.

But hibernate is logging all its info in console. Can someone please let me know a way to stop this?

I tried in eclipse and from executable jar file, still the hibernate is keep logging in console.

2

2 Answers

2
votes

Do you have hibernate.show_sql set to true somewhere in your configuration parameters? If yes, remove it.

1
votes

You can specify filter for Hibernate logs. I had such problem with log4net and HNibernate and such config helps:

<filter type="log4net.Filter.LoggerMatchFilter">
    <LoggerToMatch value="NHibernate"/>
    <acceptOnMatch value="false"/>
</filter>

You can write something like this in log4j