<property name="eclipselink.logging.level" value="FINE" />
How can I setup the logging level by server. I want to see Level.FINE on my development server. But of course only Level.WARNING on the productive server.
If I put the line above into the persistence.xml then it is automatically setup on both machines. I must remember to switch it off by hand. And that's of course dangerous.
Thanks a lot.
I have been struggling with this myself. What I have discovered is that on GlassFish (at leas on 3.1.2) you edit the logging.properties file from the GlassFish domains/domain/config directory.
Locate the org.eclipse.persistence.session.level entry and change it as follows:
org.eclipse.persistence.session.level=FINE
In addition to this, I have found I need to add these two entries:
org.eclipse.persistence.level = FINE
org.eclipse.persistence.sql.level = FINE
When editing the logging.properties file like this, there is no need to add anything to the persistence.xml file regarding logging, and it will satisfy your requirements above.
NOTE: I have not yet managed to get the eclipselink.logging.parameter=true to work in the persistence.xml (it is not assignable in the logging.properties). So the SQL logging works, just not with the full bindings dump.
You can refer EclipseLink/Examples/JPA/Logging
Note: Setting eclipselink.logging.level to FINE is not sufficient (as of EclipseLink 2.4.0 - Juno), you have to set eclipselink.logging.level.sql to FINE.
<property name="eclipselink.logging.level" value="FINE"/>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With