9

Suddenly (after working fine for some time), WildFly 9.0.1 (and also 9.0.2) seem to have somehow lost the CONSOLE handler for logging.

When trying to debug an application from NetBeans 8.0.2, the Console window shows: ERROR [stderr] (default task-14) Handler java.util.logging.ConsoleHandler is not defined as last entry, and the web application seems to be stuck (before actually starting).

In WildFly's management console, there seems to be a root logger using 2 handlers: CONSOLE and FILE. Both Handlers seem to be existing in standalone-full.xml:

  ...
    <subsystem xmlns="urn:jboss:domain:logging:3.0">
        <console-handler name="CONSOLE">
            <level name="INFO"/>
            <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"/>
            <append value="true"/>
        </periodic-rotating-file-handler>
        ...
        <root-logger>
            <level name="INFO"/>
            <handlers>
                <handler name="CONSOLE"/>
                <handler name="FILE"/>
            </handlers>
        </root-logger>
        ...
    </subsystem>
  ...

When changing config in the management console, I can delete the handlers out of the root logger. Then I can save, but taking them in again seems impossible, since I get the WFLYCTL0158, telling that the handler would not be defined.

mickey
  • 99
  • 1
  • 6
  • 2
    Seems odd since WildFly doesn't use the `java.util.logging.ConsoleHandler`. Are you using a profiler by chance when starting in NetBeans? – James R. Perkins Nov 10 '15 at 23:28
  • 1
    Same problem. In my case I am using a war that uses java.util.logging.ConsoleHandler that I cannot change. Is it possible to configure WildFly to use the same ConsoleHandler? – Martijn Burger Feb 17 '16 at 16:49
  • Hello @mickey it would be wise to leave the stack trace so we could better assist you. – Mr.Helpy Feb 24 '16 at 15:57
  • Did you ever figure this out? – mad_fox Nov 02 '17 at 15:22
  • I'm meanwhile in another employment and have no access to the stack trace. As far as I know, this problem stays unsolved. I leave it up to the admins here to either let it open for others who might have a similar problem or to remove it. Nevertheless, if anyone has a solution, I'd be interested in it for the case I get a similar situation in future. Thanks a lot anyway for all your effort! – mickey Nov 07 '17 at 15:47

1 Answers1

0

JBoss Knowledge base says you should ensure right jars (logback-classic-1.1.9.jar and logback-core-1.1.9.jar in that case) are in WEB-INF/lib directory if you are using an application framework.

UPDATE

For those who do not have access to link above, and wonder what the next steps are, you can add following to pom.xml to make it work with your application framework, which will then add it to WEB-INF/lib during the build.

<dependency>
  <groupId>ch.qos.logback</groupId>
  <artifactId>logback-classic</artifactId>
  <version>1.2.3</version>
</dependency>

<dependency>
  <groupId>ch.qos.logback</groupId>
  <artifactId>logback-core</artifactId>
  <version>1.2.3</version>
</dependency>
jkim
  • 152
  • 1
  • 3
  • 15
sm4rk0
  • 473
  • 4
  • 17