0

I am using WildFly log in debug mode and it shows a lot of unnecessary debug statements from Hibernate and I need to stop them. This is what I have changed in my standalone-full.xml.

<profile>
    <subsystem xmlns="urn:jboss:domain:logging:3.0">
        <console-handler name="CONSOLE">
            <level name="DEBUG"/>
            <formatter>
                <named-formatter name="COLOR-PATTERN"/>
            </formatter>
        </console-handler>
        <periodic-rotating-file-handler name="FILE" autoflush="true">
            <formatter>
                <named-formatter name="PATTERN"/>
            </formatter>
            <file relative-to="jboss.server.log.dir" path="server.log"/>
            <suffix value=".yyyy-MM-dd-HH"/>
            <append value="true"/>
        </periodic-rotating-file-handler>
        <logger category="com.arjuna">
            <level name="WARN"/>
        </logger>
        <logger category="org.apache.tomcat.util.modeler">
            <level name="WARN"/>
        </logger>
        <logger category="org.jboss.as.config">
            <level name="DEBUG"/>
        </logger>
        <logger category="sun.rmi">
            <level name="WARN"/>
        </logger>
        <logger category="jacorb">
            <level name="WARN"/>
        </logger>
        <logger category="jacorb.config">
            <level name="ERROR"/>
        </logger>
        <logger category="org.hibernate">
            <level name="INFO"/>
        </logger>
        <root-logger>
            <level name="DEBUG"/>
            <handlers>
                <handler name="CONSOLE"/>
                <handler name="FILE"/>
            </handlers>
        </root-logger>
        <formatter name="PATTERN">
            <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
        </formatter>
        <formatter name="COLOR-PATTERN">
            <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
        </formatter>
    </subsystem>
</profile>

But it has no effect.

Please suggest me how to do that.

My console is full with such statements.

13:19:56,260 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] 
(DefaultQuartzScheduler_Worker-10) Resolving associations for [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512575]
13:19:56,260 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Done materializing entity [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512575]
13:19:56,261 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Resolving associations for [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512576]
13:19:56,261 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Done materializing entity [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512576]
13:19:56,261 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Resolving associations for [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512577]
13:19:56,262 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Done materializing entity [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512577]
13:19:56,262 DEBUG [org.hibernate.engine.internal.TwoPhaseLoad] (DefaultQuartzScheduler_Worker-10) Resolving associations for [com.ecomm.pl4sms.persistence.entities.ErrorTable#10512578]

I want to stop these debug logs and only show the one I have added in the application.

Sevan
  • 669
  • 1
  • 5
  • 18
kirti
  • 4,499
  • 4
  • 31
  • 60

2 Answers2

1

Add a new logger entry:

<logger category="org.hibernate">
  <level name="INFO"/>
</logger>

This way only INFO and above level messages will be logged.

Also, delete the logging level line from the console-handler.

Dragan Bozanovic
  • 23,102
  • 5
  • 43
  • 110
0

Make sure your application is not using Per-deployment Logging. If that's the case the logging subsystem configurations won't have any effect.

Douglas Gardim
  • 420
  • 1
  • 4
  • 11
  • In a "Per-deployment Logging" the configuration file is in the META-INF directory, if it is an EAR deployment, or either the META-INF or WEB-INF/classes directories if it is in a WAR or JAR deployment. The possible configuration files are: logging.properties, jboss-logging.properties, log4j.properties, log4j.xml, jboss-log4j.xml. Observe that the DEBUG info was logged by the Quartz scheduler... so if you have more than one deployment, pay special attention to the deployment that is using the Quartz scheduler. – Douglas Gardim Jan 05 '16 at 13:39