0 Replies Latest reply on Jan 3, 2018 5:36 AM by rabbit10

    Custom log handler stops writing to log file after wildfly restart

    rabbit10

      Hi,

       

      I have created custom log handler by implementing java.util.logging.Handler and first time I have configured it, it worked. However, when I restarted wildfly, handler stopped working.

      Clearing wildfly cache didn't help. But, I noticed that the handler configuration also ended in logging.properties and when I removed that from logging.properties before wildfly restart - handler worked again.

      standalone.xml configuration:

       

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

                  <custom-handler name="HTTP" class="com.my.CustomHandler" module="com.my.modules">

                      <level name="INFO"/>

                      <formatter>

                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                  </custom-handler>

      ...

                  <root-logger>

                      <level name="INFO"/>

                      <handlers>

      ...

                              <handler name="HTTP"/>

                      </handlers>

                  </root-logger>

      ...

           </subsystem>

       

      Following is added after wildfly restart, and needs to be removed before each time wildfly is restarted.

       

      handler.HTTP=com.my.CustomHandler

      handler.HTTP.module=com.my.modules

      handler.HTTP.level=INFO

      handler.HTTP.formatter=HTTP

       

      formatter.HTTP=org.jboss.logmanager.formatters.PatternFormatter

      formatter.HTTP.properties=pattern

      formatter.HTTP.constructorProperties=pattern

       

      Is there any configuration property I can set so that I don't have to remove custom logger configuration from logging.properties each time wildfly is restarted in order for it to log to file?

       

      Thank you in advance!