One of the default persistence provider's database properties that you can set in the persistence.xml file is toplink.logging.level. For example, setting the logging level to FINE or higher logs all SQL statements. For details about this property, see Extensions for Logging.
You can also set the logging level globally in the Application Server in any of the following ways:
Set a module-log-levels property using the asadmin command. For example:
asadmin set --user adminuser "server.log-service.module-log-levels.property.oracle\.toplink\.essentials"=FINEST |
Set a JVM option using the asadmin command. For example:
asadmin create-jvm-options --user adminuser -Dtoplink.logging.level=FINE |
Set a module-log-levels property using the Admin Console. Select the Application Server component, the Logging tab, and the Log Levels sub-tab. Scroll down to Additional Module Log Level Properties, select Add Property, type oracle.toplink.essentials in the Name field, and type the desired logging level in the Value field.
A logging level set in the persistence.xml file takes precedence over the global logging level.