使用Weblogic 10.3记录JPA SQL [英] Logging JPA SQL with Weblogic 10.3
问题描述
通过查看Open JPA网站,我发现我可以使用以下内容记录生成的SQL:
By looking into the Open JPA website i've found that i can log the generated SQL by using the following:
<property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO"/>
如果我尝试将上述属性添加到我的persistence.xml中,我会从weblogic收到以下警告:
If i try to add the above property to my persistence.xml i get the following warning from weblogic:
<Warning> <J2EE> <BEA-160202> <You have specified a ope
njpa.Log setting in your configuration for persistence unit services.ear#services-ejb.jar#exp#exp. This setting will be ignored, and all log messages
will be sent to the WebLogic logging subsystem. Trace-level logging is controlle
d by the various JPA-specific debug settings in config.xml, or via the WebLogic
console.>
任何人都知道控制台中的选项是什么,或者我如何编辑config.xml以输出SQL?
Anyone know what is the option in the console or how i can edit my config.xml to output the SQL?
推荐答案
来自 OTN论坛以下是步骤:
- 登录weblogic控制台
- 锁定并编辑会话
- 点击环境|服务器
- 选择要监控/调试的服务器
- 单击调试选项卡
- 展开weblogic树并选择JPA节点
- 单击启用按钮
- 激活更改。
- Log into the weblogic console
- Lock and Edit the session
- Click Environment | Servers
- Select the server you wish to monitor/debug
- Click the Debug tab
- expand the weblogic tree and select the JPA node
- Click the enable button
- Activate the changes.
这可能取决于您拥有的WLS版本。我了解如果您下载了较新版本的OpenJPA ,则会出现一些问题并在WLS中使用它。
It might depend on the version of WLS you have. I understand that there were some issues if you've downloaded a newer version of OpenJPA and are using it with WLS.
除了WebLogic问题之外,您发布的配置字符串看起来有些偏差。你打算使用这样的东西(在SQL = TRACE中添加):
WebLogic issues aside, the configuration string you posted looks a bit off. Did you intend to use something like this (added in SQL=TRACE):
<property name="openjpa.Log"
value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
这篇关于使用Weblogic 10.3记录JPA SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!