简体   繁体   English

在 weblogic 控制台上查看 SQL 查询由 eclipse 链接 JPA 执行的查询或使用 Z2E025341F0D929ACE9 配置的日志文件

[英]View SQL queries executed by eclipse link JPA on weblogic console or log file configured using log4j

I am using eclipseLink 2.5.2 JPA library with weblogic 12.2.1.4.0 I want to view all the sql queries executed by JPA in the weblogic console.我正在使用 eclipseLink 2.5.2 JPA 库和 weblogic 12.2.1.4.0 我想查看所有 sql 查询在 weblogic 控制台中执行。 I have done the below changes to my persistence.xml and enabled (Redirect stdout logging enabled and Redirect stderr logging enabled):我对我的 persistence.xml 进行了以下更改并启用(启用了重定向标准输出日志记录和启用了重定向标准错误日志记录):

<property name="eclipselink.logging.file" value="output.log"/>
<property name="eclipselink.logging.logger" value="ServerLogger"/>
<property name="eclipselink.weaving" value="static" />
<property name="eclipselink.logging.level.sql" value="FINEST" />
<property name="eclipselink.logging.level" value="FINEST" />
<property name="eclipselink.logging.level.cache" value="FINEST" />
<property name="openjpa.Log" value="SQL=TRACE"/>

Still i am not able to view the generated sql in my weblogic console.我仍然无法在我的 weblogic 控制台中查看生成的 sql。 Please let me know if i have missed any configuration.如果我错过了任何配置,请告诉我。

Your configuration is telling EclipseLink that the server controls all logging when you specified <property name="eclipselink.logging.logger" value="ServerLogger"/> .当您指定<property name="eclipselink.logging.logger" value="ServerLogger"/>时,您的配置告诉 EclipseLink 服务器控制所有日志记录。 This means everything is controlled through the WebLogic logging settings, not EclipseLink, and probably why you don't see anything.这意味着一切都是通过 WebLogic 日志记录设置控制的,而不是 EclipseLink,这可能是您看不到任何东西的原因。 You will need to check the WebLogic docs on how to make changes within its console.您需要查看 WebLogic 文档以了解如何在其控制台中进行更改。

Otherwise, as per the EclipseLink documentation , you can specify <property name="eclipselink.logging.logger" value="DefaultLogger"/> to have it use the other EclipseLink property values you've defined and have them logged to the console.否则,根据 EclipseLink文档,您可以指定<property name="eclipselink.logging.logger" value="DefaultLogger"/>让它使用您定义的其他 EclipseLink 属性值并将它们记录到控制台。

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

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