0 Replies Latest reply on Feb 5, 2020 3:05 PM by George Berish

    Why doesn't System.out.printlin, and Logger work in my websocket?

    George Berish Novice

      Can anyone tell me why this doesn't work?  I.e. why nothing I log from my class, and nothing I print using System.out.println, shows up in the log or on the console?

       

      My websocket endpoint class is named "org.america3.websockets.sockets.WSEndPoint"

       

      I know it successfully deploys to Wildfly in a .WAR package (inside an .EAR package), because my html page confirms it receives a connection.

      In my endpoint class:

      @Transient

        transient final Logger logger = Logger.getLogger(this.getClass().getName());

       

       

      In my 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>

        ...

        <console-handler name="MY-CONSOLE" autoflush="true">

         <formatter>

            <named-formatter name="MY-PATTERN"/>

          </formatter>

          <target name="System.out"/>

        </console-handler>

      ...

        <console-handler name="TEST-HANDLER">

            <level name="INFO"/>

          <formatter>

            <named-formatter name="TEST-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>

      ...

        <logger category="org.america3" use-parent-handlers="false">

          <level name="ALL"/>

          <handlers>

            <handler name="TEST-HANDLER"/>

          </handlers>

        </logger>

      ...

        <root-logger>

          <level name="INFO"/>

          <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>

          <formatter name="MY-PATTERN">

            <pattern-formatter pattern="MeMeMe%s%n"/>

          </formatter>

          <formatter name="TEST-PATTERN">

           <pattern-formatter pattern="*** %s%n"/>

          </formatter>

      ...

        </subsystem>