在 EclipseLink JPA 中显示 (INSERT,UPDATE,SELECT) 的日志记录参数
Show logging parameter for (INSERT,UPDATE,SELECT) in EclipseLink JPA
我使用登录 persistence.xml 来实现 EclipseLink JPA,来自
Whosebug reference
但参数显示为 ?
如何在我的 glassfish 日志输出中正确显示它们 window.
日志级别配置包含在persistence.xml文件中持久化单元的定义中,如下:
可以通过以下属性启用或禁用 [=47=] 参数的记录:
禁用:
启用:
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
满persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ProjPU" transaction-type="JTA">
<jta-data-source>jdbc/POS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<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="eclipselink.logging.parameters" value="true" />
</properties>
</persistence-unit>
</persistence>
注意:将 eclipselink.logging.level 设置为 FINE 是不够的(从 EclipseLink 2.4.0 - Juno 开始),您必须将 eclipselink.logging.level.sql 设置为 FINE.
此 属性 还将控制参数在异常中的记录方式。默认情况下,仅记录日志级别 < CONFIG.
的参数
我使用登录 persistence.xml 来实现 EclipseLink JPA,来自
Whosebug reference
但参数显示为 ?
如何在我的 glassfish 日志输出中正确显示它们 window.
日志级别配置包含在persistence.xml文件中持久化单元的定义中,如下:
可以通过以下属性启用或禁用 [=47=] 参数的记录:
禁用:
启用:
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
满persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ProjPU" transaction-type="JTA">
<jta-data-source>jdbc/POS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<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="eclipselink.logging.parameters" value="true" />
</properties>
</persistence-unit>
</persistence>
注意:将 eclipselink.logging.level 设置为 FINE 是不够的(从 EclipseLink 2.4.0 - Juno 开始),您必须将 eclipselink.logging.level.sql 设置为 FINE.
此 属性 还将控制参数在异常中的记录方式。默认情况下,仅记录日志级别 < CONFIG.
的参数