How to disable ORM ColdFusion 10 logging

Early in the morning I woke up from a warning that my hard drive was running out of space on my CF 10 server (s). It looks like my hibernatesql.log file was above 20 GB! First, I checked my Application.cfc and confirmed that logging was disabled ...

<cfset this.ormsettings.logsql = false/>

Then I ran Googling and found that there was at least a way to keep the log file so large. You should change your / lib / log 4j.properties like this ...

# HibernateConsole is set to be a ConsoleAppender for Hibernate message  using a PatternLayout.
log4j.appender.HIBERNATECONSOLE= org.apache.log4j.RollingFileAppender
log4j.appender.HIBERNATECONSOLE.File=C:/ColdFusion10/cfusion/logs/hibernatesql.log
log4j.appender.HIBERNATECONSOLE.Append=true
log4j.appender.HIBERNATECONSOLE.MaxFileSize=5000KB
log4j.appender.HIBERNATECONSOLE.MaxBackupIndex=3
log4j.appender.HIBERNATECONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.HIBERNATECONSOLE.layout.ConversionPattern=%d{MM/dd HH:mm:ss} [%t] HIBERNATE %-5p - %m%n%

This ensures that I use no more than 15 MB of hard disk space for recording in hibernation mode. However, I really want to disable it, or at least set the log level to errors only. Any ideas?

+4
2

, log4j.properties.

log4j.appender.HIBERNATECONSOLE.Threshold = OFF

OFF, : TRACE, DEBUG, INFO, WARN, ERROR FATAL.

+1

, bug, , .

Hibernate log4j , ( SQL) log4j.properties. log4j.properties /lib. , - .

http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-how-to-log-sql/

0

All Articles