Hibernate5.2.4Final学习(三)打印DLL语句到日志 发表于 2018-03-03 | 分类于 编程 | 字数统计: 281 | 阅读时长 ≈ 2 打印日志jar:slf4j-api-1.7.7.jarslf4j-log4j12.1.7.7.jarlog4j-1.2.17.jar 配置文件log4j.properties,放在src下 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354## Hibernate, Relational Persistence for Idiomatic Java## License: GNU Lesser General Public License (LGPL), version 2.1 or later.# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.#### direct log messages to stdout ###log4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.Target=System.outlog4j.appender.stdout.layout=org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n### direct messages to file hibernate.log ####log4j.appender.file=org.apache.log4j.FileAppender#log4j.appender.file.File=hibernate.log#log4j.appender.file.layout=org.apache.log4j.PatternLayout#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n### set log levels - for more verbose logging change 'info' to 'debug' ###log4j.rootLogger=warn, stdout#log4j.logger.org.hibernate=info#log4j.logger.org.hibernate=debug### log HQL query parser activity#log4j.logger.org.hibernate.hql.ast.AST=debug### log just the SQL#log4j.logger.org.hibernate.SQL=debug### log JDBC bind parameters ####log4j.logger.org.hibernate.type=info#log4j.logger.org.hibernate.type=debug### log schema export/update ###log4j.logger.org.hibernate.tool.hbm2ddl=debug### log HQL parse trees#log4j.logger.org.hibernate.hql=debug### log cache activity ####log4j.logger.org.hibernate.cache=debug### log transaction activity#log4j.logger.org.hibernate.transaction=debug### log JDBC resource acquisition#log4j.logger.org.hibernate.jdbc=debug### enable the following line if you want to track down connection ###### leakages when using DriverManagerConnectionProvider ####log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace 您的支持将是我前进的不懈动力 打赏 微信支付 支付宝 本文作者: Lloyd 本文链接: https://nicklinyi.gitee.io/blog/2018/03/HibernateStu03.html 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!