Hi,
This seems like it would be a common use case but I don't see it
discussed anywhere.
We want:
- 2 appenders, 'stderr' and 'SQL'
- 'general' logging goes only to the 'stderr' appender
- SQL log messages (logger=org.hibernate.SQL) goes to both appenders
- JDBC bind params (logger=org.hibernate.type) goes only to the 'SQL'
appender
I've tried a number of different combinations of logging config in the
log4j.properties file but I cannot get the desired behaviour.
Here is a snippet of the log4j.properties file:
# direct log messages to stderr, which is re-directed by Tomcat
# to the tomcat logs.
log4j.appender.stderr = org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Target = System.err
log4j.appender.stderr.layout = org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern = -----%n%p from %l %n%m
%n
# uncomment this block to create a separate logfile in logs/
log4j.appender.SQL=org.apache.log4j.RollingFileAppender
log4j.appender.SQL.File=./logs/hibernate.log
log4j.appender.SQL.layout=org.apache.log4j.SimpleLayout
log4j.appender.SQL.MaxFileSize=2000KB
log4j.rootLogger=warn, stderr
log4j.logger.org.hibernate.SQL = debug
log4j.logger.org.hibernate.type = debug, SQL
log4j.logger.org.hibernate.type = warn, stderr
thanks for any/all help.
matt h
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org