1 Reply Latest reply on Oct 24, 2016 1:51 PM by jamezp

    Wildfly 9 - log configuration

    dominique_claes

      Is there a property that can be set to the handler 'periodic-rotating-file-handler' so that the server log isn't overwritten for that day when the server reboots?

      So I want multiple server logs from the same day every time the server reboots.

      Or does a future Wildfly release support such an option?

       

      My current configuration is the following:

       

      <periodic-rotating-file-handler name="FILE" autoflush="true">

           <level name="INFO"/>

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

       

      <formatter name="PATTERN">

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

      </formatter>

        • 1. Re: Wildfly 9 - log configuration
          jamezp

          You could use a periodic-size-rotating-file-handler which allows for rotation on boot. One thing to note is on WildFly 9 it seems to rotate the file twice during boot. This seems to be fixed in WildFly 10 however.

           

          /subsystem=logging/periodic-size-rotating-file-handler=test:add(rotate-on-boot=true, append=true, autoflush=true, max-backup-index=20, suffix=".yyyy-MM-dd", named-formatter=PATTERN, file={relative-to=jboss.server.log.dir, path="test.log"})
          /subsystem=logging/root-logger=ROOT:add-handler(name=test)
          

           

          --

          James R. Perkins