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 inTopLink JPA Extensions Reference.
You can also set the TopLink Essentials 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"=FINE |
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. In the developer profile, select the Application Server component and the Logging tab. In the cluster profile, select the Logger Settings component under the relevant configuration. Select the Log Levels tab. Then 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.
Setting the logging level to OFF disables TopLink Essentials logging. A logging level set in the persistence.xml file takes precedence over the global logging level.
You can set the logging level for Java Persistence in general using the Admin Console. In the developer profile, select the Application Server component and the Logging tab. In the cluster profile, select the Logger Settings component under the relevant configuration. Select the Log Levels tab. Then set the logging level for Persistence. Setting the logging level to OFF disables Java Persistence logging.