How to enable JPA eclipselink logging in WAS Liberty
When this goes well, you are happy but every developer hits situation when you need more logs and details to troubleshoot issue and determine root case. It happens many times when you work with JPA and thing don't goes as you expect. You really need to look under the hood what JPA is going, what SQL statements it's generating and executing.
Environment: WAS Liberty 17.0.01, JAVA EE 7, JPA 2.1, EclipseLink 2.6.3
In above environment, to enable JPA logging including SQL statements, bind parameters and transaction details do following -
<property name="eclipselink.logging.level" value="ALL"/>
<property name="eclipselink.logging.parameters" value="true"/>
<logging traceSpecification="eclipselink=all" maxFileSize="20" maxFiles="10"/>
Redeploy application and recycle server. All done!
This will enable JPA logging and you can see all log messages in server's trace.log file.
I hope it help you, if yes pls share and comment!
References:
https://www.ibm.com/support/knowledgecenter/en/SS7K4U_9.0.0/com.ibm.websphere.zseries.doc/ae/tejb_loggingwjpa.html
References:
https://www.ibm.com/support/knowledgecenter/en/SS7K4U_9.0.0/com.ibm.websphere.zseries.doc/ae/tejb_loggingwjpa.html
Comments
Post a Comment