在使用Debug日志记录运行de Playframework时,我突然收到了大量非常详细的调试信息。我不知道这是怎么发生的,也看不出如何改变它。我使用DEBUG级别进行自己的日志记录,但是我自己的日志消息现在被大量的框架的DEBUG输出吞没了,这很快。
我做过的唯一一件事(我认为)被称为“播放依赖关系”'它可能已经下载了可能永远不会出现的记录器等版本。
另外,由于我自己添加了依赖项,因此在运行“依赖项”时使用了--verbose命令。但这不应该影响我认为的框架本身的运行。我在文档中找不到任何内容。任何人都可以帮我改变这一点。我附上了DEBUG输出的一小部分样本用于说明。
(编辑:我正在使用Play!1.2.4。无论我在配置文件中设置了什么日志记录级别,DEBUG信息都会一直显示)
14:32:26.626 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开ResultSet(打开ResultSet:0,全局:0)14:32:26.627 [play-thread-1] DEBUG org.hibernate.loader.Loader - 结果行:EntityKey [models.User#1] 14:32:26.627 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭ResultSet (打开ResultSet:1,全局:1)14:32:26.627 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭PreparedStatement (打开PreparedStatements:1,全球:1)14:32:26.627 [play-thread-1] DEBUG o.h.e.StatefulPersistenceContext - 初始化非惰性 收集14:32:26.630 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开PreparedStatement (打开PreparedStatements:0,全局:0)14:32:26.630 [play-thread-1] DEBUG org.hibernate.SQL - 选择user0_.id为id5_,user0_.addDate为 addDate5_,user0_.lastUpdate as lastUpdate5_,user0_.app_id as app11_5_,user0_.blocked为blocked5_,user0_.email为email5_, user0_.firstName as firstName5_,user0_.lastName as lastName5_, user0_.passwordHash为password8_5_,user0_.userName为userName5_, user0_.userType作为userType5_来自用户user0_,其中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(打开ResultSet:1,全局:1)14:32:26.631 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭PreparedStatement(打开PreparedStatements:1,全局:1)14:32:26.631 [play-thread-1] DEBUG o.h.e.StatefulPersistenceContext - 初始化非惰性集合 14:32:26.634 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开PreparedStatement(打开PreparedStatements:0,全局:0)14:32:26.634 [play-thread-1] DEBUG org.hibernate.SQL - 选择user0_.id为id5_,user0_.addDate为addDate5_, user0_.lastUpdate as lastUpdate5_,user0_.app_id as app11_5_, user0_.blocked为blocked5_,user0_.email为email5_,user0_.firstName as firstName5_,user0_.lastName as lastName5_,user0_.passwordHash as password8_5_,user0_.userName as userName5_,user0_.userType as userType5_来自用户user0_,其中user0_.userName =?限制? 14:32:26.635 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开ResultSet(打开ResultSet:0,全局:0)14:32:26.635 [play-thread-1] DEBUG org.hibernate.loader.Loader - 结果行:EntityKey [models.User#1] 14:32:26.635 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭ResultSet (打开ResultSet:1,全局:1)14:32:26.635 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭PreparedStatement (打开PreparedStatements:1,全球:1)14:32:26.635 [play-thread-1] DEBUG o.h.e.StatefulPersistenceContext - 初始化非惰性 收集14:32:26.637 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将打开PreparedStatement (打开PreparedStatements:0,全局:0)14:32:26.637 [play-thread-1] DEBUG org.hibernate.SQL - 选择user0_.id为id5_,user0_.addDate为 addDate5_,user0_.lastUpdate as lastUpdate5_,user0_.app_id as app11_5_,user0_.blocked为blocked5_,user0_.email为email5_, user0_.firstName as firstName5_,user0_.lastName as 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(打开ResultSet:1,全局:1)14:32:26.638 [play-thread-1] DEBUG org.hibernate.jdbc.AbstractBatcher - 即将关闭PreparedStatement(打开PreparedStatements:1,全局:1)
答案 0 :(得分:1)
这些日志消息来自logback库。将logback.xml配置文件添加到类路径中。
答案 1 :(得分:0)
您可以创建一个log4j.properties文件并将其放在conf文件夹中。然后根据您的要求进行修改。