简体   繁体   English

无法更改GlassFish中的TopLink日志记录级别

[英]Unable to change TopLink logging level in GlassFish

In a GlassFish 2.1 environment, I am trying to increase the logging level for TopLink... to see the raw SQL being generated. 在GlassFish 2.1环境中,我试图提高TopLink的日志记录级别...以查看正在生成的原始SQL。 In the GlassFish Admin Console, I go to: 在GlassFish管理控制台中,我转到:

Configurations -> my-config -> Logger Settings -> "Log Levels" tab

The logging level for TopLink is determined by the "Persistence" pulldown menu. TopLink的日志记录级别由“持久性”下拉菜单确定。 To dump generated SQL to the logs, you increase the level from "SEVERE" to "FINE" (or greater). 要将生成的SQL转储到日志中,请将级别从“严重”提高到“精细”(或更高)。

I've done this before on multiple other GlassFish boxes. 我之前在其他多个GlassFish盒子上都这样做过。 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 (eg "JMS", "JTA", etc). 真正令人困惑的是,我可以成功更新系统中其他所有类别的日志记录级别(例如“ JMS”,“ JTA”等)。 The problem is specific to the "Persistence" category. 该问题特定于“持久性”类别。

Anyone ever encountered this problem before? 有人遇到过这个问题吗? Any thoughts would be appreciated. 任何想法将不胜感激。

Odd. 奇。

You can always set the log level directly in your JPA persistence.xml, 您始终可以直接在JPA persistence.xml中设置日志级别,

"toplink.logging.level"="fine"

I eventually confirmed with Oracle that this was a bug in this particular version of GlassFish. 我最终与Oracle确认,这是该特定版本的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. 对于3.x或更高版本的GlassFish而言,这不是问题,最终将有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. 将属性名称设置为“ oracle.toplink.essentials”(在“持久性”下拉列表旁边指示的相同程序包名称),然后将属性值设置为所需的任何日志记录级别。

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. 单击“保存”将从“其他属性”部分中删除该条目,但是“持久性”下拉列表将设置为您输入的日志记录级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM