2016-08-03 76 views

回答

1

日志级别设定包含在在的persistence.xml文件中的持久性单元定义如下:

的SQL参数的测井可以启用,禁用或通过以下属性:

禁用:

启用:

<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 - 朱诺),你必须设置的EclipseLink .logging.level.sqlFINE

该属性还将控制参数在异常情况下的记录方式。默认情况下,仅记录日志级别的参数< CONFIG

Refernce:DocumentationWiki Ecipse link

相关问题