To get logging working properly with EclipseLink 2.3.2 and GlassFish 3.1.2.2, you want to configure the actual logging values in GlassFish’s logging.properties
file, not in your META-INF/persistence.xml
file. You have to set two levels (a bit mysterious, as one is a child of the other; setting values on the parent logger should cause them to flow downhill, but for some reason they do not).
Then, to be able to see SQL parameters in the output, you have to set a property in your META-INF/persistence.xml
file.
Assuming you have a domain called domain1
:
- Edit
$GLASSFISH_HOME/glassfish/domains/domain1/config/logging.properties
and add the following lines:org.eclipse.persistence.level = FINE
org.eclipse.persistence.sql.level = FINE
- The first allows you to see SQL statements. The second must be set in order for SQL parameters to be seen, but it is not sufficient on its own.
- In your
META-INF/persistence.xml
, add the following element as a child of the<properties>
element:
<property name="eclipselink.logging.parameters" value="true"/>
I also add
to the file META-INF/persistence.xml