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 - Add following tow properties in persistence.xml <property name="eclipselink.logging.level" value="ALL"/> <property name="eclipselink.logging.parameters" value="true"/> Add following logging tag in server.xml <logging traceSpecification="eclipselink=all" maxFileSize="20" maxFiles="10"/> Redeploy application and recycle server. All done! T
Comments
Post a Comment