I'm using Eclipselink JPA provider, and noticed that it writes in console only. I configured both the console and file appenders, but EclipseLink log entries (SQL queries for example) are appeared only in the console log. How to fix it?
Here is my log4j configuration:
log4j.rootLogger=ALL, FILE, CONSOLE
log4j.logger.uk.co.mycompany=DEBUG
log4j.logger.org.eclipse.persistence=ALL
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=${catalina.base}/logs/application.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss, SSS} %t [%p] %c{1} - %m%n
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%p] %m%ne
In the persistence.xml:
...
<properties>
<property name="eclipselink.logging.level" value="FINE"/>
</properties>
Eclipse Link doesn't use log4j by default. This page describes how you can integrate it:
http://wiki.eclipse.org/EclipseLink/Foundation/Logging
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