0
誰かが別のファイルにすべてのSQL文を記録する方法を教えてもらえますか?Log4jとhibernate sql
# Root logger option
log4j.rootLogger=INFO, file, stdout, hibernate, sql
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/home/karq/proovikas.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
#log hibernate
log4j.appender.hibernate = org.apache.log4j.RollingFileAppender
log4j.appender.hibernate.File=/home/karq/hibernate.log
log4j.appender.hibernate.MaxFileSize=2MB
log4j.appender.hibernate.MaxBackupIndex=1
log4j.appender.hibernate.layout=org.apache.log4j.PatternLayout
log4j.appender.hibernate.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.category.com.karq.server = INFO, hibernate
log4j.category.org.hibernate = INFO, hibernate
log4j.category.org.hibernate.type = INFO, hibernate
log4j.additivity.org.hibernate=false
log4j.additivity.org.hibernate.type=false
log4j.additivity.com.karq.server=false
#log hibernate
log4j.appender.sql = org.apache.log4j.RollingFileAppender
log4j.appender.sql.File=/home/karq/sql.log
log4j.appender.sql.MaxFileSize=2MB
log4j.appender.sql.MaxBackupIndex=1
log4j.appender.sql.layout=org.apache.log4j.PatternLayout
log4j.appender.sql.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.category.org.hibernate.SQL = INFO, sql
log4j.additivity.org.hibernate.SQL=false
hibernate.show_sqlを有効にしましたか? – ssedano
はい有効にしました – karq