无法更改 GlassFish 中的 TopLink 日志记录级别
在 GlassFish 2.1 环境中,我尝试提高 TopLink 的日志记录级别...以查看生成的原始 SQL。在 GlassFish 管理控制台中,我转到:
Configurations -> my-config -> Logger Settings -> "Log Levels" tab
TopLink 的日志记录级别由“持久性”下拉菜单确定。要将生成的 SQL 转储到日志中,请将级别从“SEVERE”增加到“FINE”(或更高)。
我之前已经在多个其他 GlassFish 盒子上做过此操作。但是,在单击“保存”按钮后,此框中的值始终恢复为“严重”。管理控制台中没有错误消息,也没有任何我能找到的记录......新值根本不存在。
真正令人困惑的是,我可以成功更新系统中每个其他类别的日志记录级别(例如“JMS”、“JTA”等)。该问题特定于“持久性”类别。
以前有人遇到过这个问题吗?任何想法将不胜感激。
In a GlassFish 2.1 environment, I am trying to increase the logging level for TopLink... to see the raw SQL being generated. In the GlassFish Admin Console, I go to:
Configurations -> my-config -> Logger Settings -> "Log Levels" tab
The logging level for TopLink is determined by the "Persistence" pulldown menu. To dump generated SQL to the logs, you increase the level from "SEVERE" to "FINE" (or greater).
I've done this before on multiple other GlassFish boxes. However, on THIS box the value always reverts back to "SEVERE" after I click the Save button. No error message in the Admin Console, and nothing logged that I can find... the new value simply doesn't stick.
The really confusing thing is that I CAN successfully update the logging level for every other category in the system (e.g. "JMS", "JTA", etc). The problem is specific to the "Persistence" category.
Anyone ever encountered this problem before? Any thoughts would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
奇怪的。
您始终可以直接在 JPA persistence.xml 中设置日志级别,
Odd.
You can always set the log level directly in your JPA persistence.xml,
我最终向 Oracle 确认这是这个特定版本的 GlassFish 中的一个错误。对于使用了 3.x 代 GlassFish 的用户来说,这应该不是问题,并且最终将会有 2.1x 的更新。
不过,我暂时找到了解决方法。在“日志级别”页面上,在底部的“其他属性”部分添加一个新属性。将属性名称设置为“oracle.toplink.essentials”(与“持久性”下拉列表旁边指示的包名称相同),并将属性值设置为您想要的任何日志记录级别。
单击“保存”将从“其他属性”部分中删除此条目,但“持久性”下拉列表将设置为您输入的日志记录级别。
I eventually confirmed with Oracle that this was a bug in this particular version of GlassFish. Shouldn't be an issue for people who are up to the 3.x generation of GlassFish, and there will eventually be an update for 2.1x.
I have found a workaround for the meantime, though. On that "Log Levels" page, add a new property in the "Additional Properties" section at the bottom. Set the property Name to "oracle.toplink.essentials" (the same package name indicated beside the "Persistence" pulldown), and set the property Value to whatever logging level you want.
Clicking Save will remove this entry from the "Additional Properties" section, but the "Persistence" pulldown will be set to the logging level you had entered.