Search code examples
loggingeclipselink

eclipselink.logging.file is not working for me


I am using Eclipselink 2.3.0 in a new project that is deployed in Glassfish 3.1.2 in an EAR file.

These are all the properties defined in my persistence.xml:

<property name="eclipselink.target-database" value="MySQL"/>
<property name="eclipselink.logging.logger" value="DefaultLogger"/>
<property name="eclipselink.logging.file" value="\logs\eclipselink.log"/>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.logging.timestamp" value="true"/>
<property name="eclipselink.logging.thread" value="true"/>
<property name="eclipselink.logging.session" value="true"/>
<property name="eclipselink.logging.exceptions" value="true"/>

All of the properties work as expected, except for eclipselink.logging.file. It creates the file "\logs\eclipselink.log", but it is always empty, and the logging output goes to stdout.

I have tried changing from DefaultLogger to JavaLogger, and the file name to have the other direction slashes, etc, etc. Everything I try results in an empty log file, and the logging output going to stdout.

Any ideas as to why this is happening? It seems to me like EclipseLink is reading the properties correctly, and creating the file, but somewhere the output is being redirected to stdout.

P.S. There is only one persistence.xml in the EAR project, and this is the only project deployed in the Glassfish instance.


Solution

  • From looking at the code that processes the properties, it seems it may be a bug. Are you using a managed or application managed persistence unit?

    My guess, is if you create your own subclass of DefaultSessionLog the file property will be applied. You could also try setting the log file in a SessionCustomizer.

    Please log a bug.