10

是否可以在休眠中设置日志记录以仅显示 UPDATE、INSERT 和 DELETE 查询,但不显示 SELECT?我已将 show_sql 属性设置为 true,但应用程序通过大量选择查询向我的控制台发送垃圾邮件。可以这样配置吗?

我将 postgres 与 Spring 和 jboss 一起使用。

我将不胜感激任何帮助:)

4

1 回答 1

0

It might be possible to configure this through log4j.xml of Hibernate logging system, and then apply a Regex to write only the desired log entries.

http://logging.apache.org/log4j/2.x/manual/filters.html#RegexFilter

于 2013-11-25T20:05:31.147 回答