JPA 2.0(日志记录和跟踪)与 Glassfish 3.0.1 和 NetBeans 6.9.1:
我正在将 JPA 2.0(EclipseLink 提供程序)与 Glassfish v3.0.1 和 NetBeans 6.9.1 一起使用,但我不是能够查看 JPA 2.0 中的查询和其他日志记录信息。本质上我希望能够看到 JPA 生成的所有 SQL 语句以及其他相关的调试信息...
是否有人成功地能够配置日志记录以提供此类反馈?我已经尝试了几件事但无济于事......
任何帮助将不胜感激。
非常感谢。
I am using JPA 2.0 (EclipseLink provider) with Glassfish v3.0.1 and NetBeans 6.9.1 and am NOT able to see the queries and other logging information from JPA 2.0. Essentially I want to be able to see all the SQL statements which are being generated by JPA and other related debugging information...
Has anyone successfully been able to configure the logging to provide such feedback? I've tried several things to no avail...
Any help would be greatly appreciated.
Thanks much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最终对我有用的是:
in conjunction with your recommended tag of:
This allowed me to see the relevant JPA logs which in NetBeans output window. This also worked in Eclipse. The output was sent do the console window an intermingled with the server's output which was exactly what I wanted.
What eventually had done the trick for me was using:
in conjunction with your recommended tag of:
This allowed me to see the relevant JPA logs which in NetBeans output window. This also worked in Eclipse. The output was sent do the console window an intermingled with the server's output which was exactly what I wanted.
您必须在 persistence.xml 文件中配置日志记录级别。
示例:
日志级别:
关闭
严重
警告
信息
配置 - 将其用于生产
很好
更细
最好的
更多信息: http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging< /a>
所有查询都将打印在域 server.log 文件中。
You must configure logging level in persistence.xml file.
Example:
Log Levels:
OFF
SEVERE
WARNING
INFO
CONFIG - Use this for Production
FINE
FINER
FINEST
More info: http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging
All the queries would be printed in the domain server.log file.