Hi guys,
I am using appfuse 1.9.4 and running in Tomcat 6.0.14. below is the
/WEB-INF/classes/log4j.properties
# This is the configuring for logging displayed in the Application Server
#log4j.rootCategory=INFO, stdout
# Replace the line above if you want to put a log file into the directory
# you start Tomcat from
log4j.rootCategory=ERROR, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=[stufftolet] %p [%t]
%c{1}.%M(%L) | %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
# You can change this to be an absolute path or even an environment variable
# If you're using an environment variable, you will have to set JAVA_OPTS
# to contain this variables - for example in the catalina.sh or catalina.bat
# file
log4j.appender.R.File=/opt/tomcat6/logs/stufftolet.log
# log4j.appender.R.File=/var/log/tomcat5/stufftolet.log
log4j.appender.R.MaxFileSize=50000KB
# Don't keep a backup file
log4j.appender.R.MaxBackupIndex=0
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
# Configuration for receiving e-mails when ERROR messages occur.
log4j.appender.mail=org.apache.log4j.net.SMTPAppender
[EMAIL PROTECTED]
[EMAIL PROTECTED]
log4j.appender.mail.SMTPHost=stufftolet.com
log4j.appender.mail.Threshold=ERROR
log4j.appender.mail.BufferSize=1
log4j.appender.mail.Subject=[stufftolet.com] Stufftolet Application Error
log4j.appender.mail.layout=org.apache.log4j.PatternLayout
log4j.appender.mail.layout.ConversionPattern=%d %-5p %c %x - %m%n
# If programmed properly the most messages would be at DEBUG
# and the least at FATAL.
log4j.logger.com.stufftolet=DEBUG
log4j.logger.com.stufftolet.webapp.filter=ERROR
log4j.logger.com.stufftolet.webapp.listener.UserCounterListener=WARN
log4j.logger.com.stufftolet.util=WARN
# Control logging for other open source packages
log4j.logger.com.opensymphony.oscache=ERROR
log4j.logger.net.sf.navigator=ERROR
log4j.logger.org.acegisecurity=WARN
log4j.logger.org.acegisecurity.intercept.event.LoggerListener=WARN
log4j.logger.org.apache.commons=ERROR
# Suppress warnings from VariableResolverImpl.resolveVariable
log4j.logger.org.apache.myfaces=ERROR
log4j.logger.org.displaytag=ERROR
log4j.logger.org.springframework=ERROR
log4j.logger.org.apache.velocity=ERROR
log4j.logger.org.tuckey.web.filters=ERROR
# Don't show debug logs for WebTest
log4j.logger.com.canoo.webtest=WARN
# All hibernate log output of "info" level or higher goes to stdout.
# For more verbose logging, change the "info" to "debug" on the last line.
log4j.logger.org.hibernate.ps.PreparedStatementCache=ERROR
log4j.logger.org.hibernate=ERROR
log4j.logger.com.stufftolet.level=ERROR
log4j.logger.org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlMessageRendererBase=ERROR
log4j.logger.org.hibernate.exception=ERROR
log4j.logger.org.hibernate.SQL=ERROR
log4j.logger.org.hibernate.type=ERROR
log4j.logger.com.opensymphony=ERROR
log4j.logger.javax.faces.webapp=ERROR
log4j.logger.net.sf.ehcache.Cache=WARN
log4j.logger.uk.ltd.getahead.dwr=ERROR
log4j.logger.org.quartz=ERROR
log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=SEVERE
log4j.logger.org.codehaus.xfire=ERROR
log4j.logger.httpclient=ERROR
log4j.logger.org.hibernate.exception.ConstraintViolationException=FATAL
As you see, I have already set hibernate to ERROR and yet I still get output
like below:
DEBUG TP-Processor2 org.hibernate.event.def.AbstractFlushingEventListener -
executing flush
DEBUG TP-Processor2 org.hibernate.event.def.AbstractFlushingEventListener -
post flush
INFO TP-Processor8 com.stufftolet.webapp.action.ApplicationScopeBean -
reinitializing Provinces ...
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
flushing session
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
processing flush-time cascades
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
dirty checking collections
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Flushing entities and processing referenced collections
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Processing unreferenced collections
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Scheduling collection removes/(re)creates/updates
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Flushed: 1 insertions, 0 updates, 0 deletions to 34 objects
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Flushed: 0 (re)creations, 0 updates, 0 removals to 33 collections
DEBUG TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
executing flush
ERROR TP-Processor8 org.hibernate.util.JDBCExceptionReporter - Duplicate
entry '2007-11-14 00:00:00-8008' for key 1
ERROR TP-Processor8 org.hibernate.event.def.AbstractFlushingEventListener -
Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC
batch update
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:561)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:611)
so how can I prevent the
org.hibernate.event.def.AbstractFlushingEventListener write into the log
file and also org.hibernate.exception.ConstraintViolationException not write
to the log file too.
Appreciate anyone can help me here. Thanks !
regards,
Mark
--
View this message in context:
http://www.nabble.com/how-to-set-hibernate-log-level-to-ERROR-tf4804148.html#a13744124
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]