0

在运行带有调试日志记录的 de Playframework 时,我突然得到了很多非常冗长的调试信息。我不知道这是怎么发生的,也看不到如何改变它。我将 DEBUG 级别用于我自己的日志记录,但我自己的日志消息现在被框架的 DEBUG 输出吞没了,速度很快。

我所做的唯一一件事(我认为)被称为“播放依赖项”,它可能已经下载了可能永远不会下载的记录器版本等。

另外,当我自己添加一个依赖项时,我在运行“依赖项”时使用了 --verbose 命令,但这不应该影响我认为的框架本身的运行。我在文档中找不到任何内容。任何可以帮助我改变这一点的人。我附上了一个 DEBUG 输出的小样本以作说明。

(编辑:我正在使用 Play!1.2.4。无论我在配置文件中设置什么日志记录级别,调试信息都会一直显示)

id 为 id5_,user0_.addDate 为 addDate5_,user0_.lastUpdate 为 lastUpdate5_,user0_.app_id 为 app11_5_,user0_.blocked 为 block5_,user0_.email 为 email5_,user0_.firstName 为 firstName5_,user0_.lastName 为 lastName5_,user0_.passwordHash 为password8_5_,user0_.userName 作为 userName5_,user0_.userType 作为 userType5_ 从用户 user0_ where user0_.userName=? 限制 ?14:32:26.631 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.631 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.631 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1) 14:32:26.631 [play-thread-1] 调试 org.hibernate.jdbc。AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1) 14:32:26.631 [play-thread-1] DEBUG oheStatefulPersistenceContext - 初始化非惰性集合 14:32:26.634 [play-thread-1] DEBUG org .hibernate.jdbc.AbstractBatcher - 即将打开 PreparedStatement (打开 PreparedStatements: 0, global: 0) 14:32:26.634 [play-thread-1] DEBUG org.hibernate.SQL - 选择 user0_.id 作为 id5_, user0_.addDate as addDate5_, user0_.lastUpdate as lastUpdate5_, user0_.app_id as app11_5_, user0_.blocked as blocked5_, user0_.email as email5_, user0_.firstName as firstName5_, user0_.lastName as lastName5_, user0_.passwordHash as password8_5_, user0_.userName as userName5_ , user0_.userType as userType5_ from User user0_ where user0_.userName=? 限制 ?14:32:26.635 [play-thread-1] 调试 org.hibernate.jdbc。lastUpdate 为 lastUpdate5_,user0_.app_id 为 app11_5_,user0_.blocked 为 block5_,user0_.email 为 email5_,user0_.firstName 为 firstName5_,user0_.lastName 为 lastName5_,user0_.passwordHash 为 password8_5_,user0_.userName 为 userName5_,user0_.userType 为userType5_ 来自用户 user0_ 其中 user0_.userName=? 限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)app_id 作为app11_5_,user0_.blocked 作为blocked5_,user0_.email 作为email5_,user0_.firstName 作为firstName5_,user0_.lastName 作为lastName5_,user0_.passwordHash 作为password8_5_,user0_.userName 作为userName5_,user0_.userType 作为userType5_ from User user0_ where user0_ .用户名=?限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)app_id 作为app11_5_,user0_.blocked 作为blocked5_,user0_.email 作为email5_,user0_.firstName 作为firstName5_,user0_.lastName 作为lastName5_,user0_.passwordHash 作为password8_5_,user0_.userName 作为userName5_,user0_.userType 作为userType5_ from User user0_ where user0_ .用户名=?限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)user0_.email 作为 email5_,user0_.firstName 作为 firstName5_,user0_.lastName 作为 lastName5_,user0_.passwordHash 作为 password8_5_,user0_.userName 作为 userName5_,user0_.userType 作为 userType5_ from User user0_ where user0_.userName=? 限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)user0_.email 作为 email5_,user0_.firstName 作为 firstName5_,user0_.lastName 作为 lastName5_,user0_.passwordHash 作为 password8_5_,user0_.userName 作为 userName5_,user0_.userType 作为 userType5_ from User user0_ where user0_.userName=? 限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)user0_.passwordHash as password8_5_, user0_.userName as userName5_, user0_.userType as userType5_ from User user0_ where user0_.userName=? 限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)user0_.passwordHash as password8_5_, user0_.userName as userName5_, user0_.userType as userType5_ from User user0_ where user0_.userName=? 限制 ?14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开 ResultSet(打开 ResultSets:0,全局:0) 14:32:26.638 [play-thread-1] DEBUG org. hibernate.loader.Loader - 结果行:EntityKey[models.User#1] 14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 ResultSet(打开 ResultSets:1,全局: 1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭 PreparedStatement(打开 PreparedStatements:1,全局:1)

4

2 回答 2

1

这些日志消息来自logback库。将 logback.xml 配置文件添加到类路径。

于 2012-05-01T15:14:05.497 回答
0

您可以创建一个 log4j.properties 文件并将其放在您的 conf 文件夹中。然后根据您的要求对其进行修改。

于 2012-05-01T11:14:34.417 回答