How to activate JDBC logs in wildfly

I am using wildfly with EclipseLink and I want to track SQL queries. I configured EclipseLink according to the documentation , everything works fine except for SQL logs. I added these properties to my persistence.xml:

    <properties>
        <property name="eclipselink.logging.level.sql" value="FINE" />
        <property name="eclipselink.logging.parameters" value="true" />
        <property name="eclipselink.debug" value="OFF" />
        <property name="eclipselink.weaving" value="static" />
        <property name="eclipselink.logging.logger" value="DefaultLogger" />
    </properties>

but no SQL logs. What am I doing wrong?

+4
source share
1 answer

Here is what works for me. I am using Wildfly 8.2.0, eclipselink 2.5.1.

Just add

        <logger category="org.eclipse.persistence.sql">
            <level name="DEBUG"/>
        </logger>

        <logger category="org.jboss.as.jpa">
            <level name="DEBUG"/>
        </logger>

for the registration subsystem in the standalone.xml file (in the configuration folder).

Only between

<subsystem xmlns="urn:jboss:domain:logging:2.0">

......

</subsystem>

The logging level for the console handler must be set to at least DEBUG, for example:

        <console-handler name="CONSOLE">
            <level name="DEBUG"/>
            <formatter>
                <named-formatter name="COLOR-PATTERN"/>
            </formatter>
        </console-handler>

.

.

+4

All Articles