EclipseLinkではjava.util.loggingを使っているため、そのままではSLF4Jとは別にロギングしていまいます。ロギングをSLF4Jに一本化するために、独自のSessionLogを実装します。
SessionLoggerの実装はここを参考にしました。EclipseLink側のログレベルの方が細かいので、お好みでマッピングしてください。
あとはSessionCustmizerで作成したSessionLoggerを設定し、persistence.xmlに追記したらOK!
persistence.xml
<properties>
<property name="eclipselink.session.customizer" value="misc.jpa.JpaSessionCustomizer"/>
</properties>
JpaSessionCustomizer.java
package misc.jpa;
import org.eclipse.persistence.config.SessionCustomizer;
import org.eclipse.persistence.sessions.Session;
public class JpaSessionCustomizer implements SessionCustomizer {
@Override
public void customize(Session sn) throws Exception {
sn.setSessionLog(new Slf4jSessionLogger());
}
}