Преглед изворни кода

Log Hibernate DML/DDL in log4j instead of stdout

peter_backlund пре 18 година
родитељ
комит
c20e1e9e61

+ 1
- 2
dddsample/src/main/resources/hibernate.properties Прегледај датотеку

@@ -1,3 +1,2 @@
1 1
 hibernate.hbm2ddl.auto=create-drop
2
-hibernate.show_sql=false
3
-#hibernate.format_sql=true
2
+hibernate.format_sql=true

+ 3
- 1
dddsample/src/main/resources/log4j.properties Прегледај датотеку

@@ -4,4 +4,6 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4 4
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5 5
 log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
6 6
 
7
-log4j.logger.net.sf.ehcache.config.ConfigurationFactory=error
7
+log4j.logger.net.sf.ehcache.config.ConfigurationFactory=error
8
+
9
+log4j.logger.org.hibernate.SQL=debug

+ 0
- 2
dddsample/src/test/resources/hibernate.properties Прегледај датотеку

@@ -1,3 +1 @@
1 1
 hibernate.hbm2ddl.auto=create-drop
2
-hibernate.show_sql=true
3
-hibernate.format_sql=true

+ 2
- 1
dddsample/src/test/resources/log4j.properties Прегледај датотеку

@@ -7,7 +7,8 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
7 7
 log4j.logger.net.sf.ehcache.config.ConfigurationFactory=error
8 8
 
9 9
 log4j.logger.se.citerus.dddsample=debug
10
-log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=debug
10
+log4j.logger.org.hibernate.SQL=debug
11
+#log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=debug
11 12
 
12 13
 #log4j.logger.org.springframework.orm=debug
13 14
 #log4j.logger.org.springframework.transaction=debug