7 Replies Latest reply on Nov 4, 2013 7:06 PM by georgemat

    WILDFLY logging, files truncate upon rotation.

    georgemat Newbie

      Using WILDFLY Alpha3.  Unless otherwise this had been identified as a BUG and got fixed in later versions, we are unable to move to another version as our schedule is hectic.

       

      We have been using deployment specific 'log4j-1.2.16.jar' (import org.apache.log4j.Logger) for logging into server.log.

       

      I made an attempt to use jboss logging by importing org.jboss.logging.Logger and made changes to class

      path locations  point to jboss version of jar file (jboss-logging-3.1.3.GA.jar).

       

      I still am having problems with log truncation upon rotation. server.log, server.log.1, server.log.3 etc.

      With the following entry in standalone-full.xml, it sometimes misses a file, for example, I see server.log.1,

      then server.log.3, but not server.log.2. If I look at the time stamp between those files, I do see a big gap.

      I reduced the size of the file to see results quickly. Our normal file size is set to 53m and not 50k.

       

                  <size-rotating-file-handler name="FILE">

                      <formatter>

                          <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                      <rotate-size value="50k"/>

                      <max-backup-index value="8"/>

                      <append value="false"/>

                  </size-rotating-file-handler>

       

      I hope, some one could point to me a viable solution.

       

      Thank you,

      George

        • 1. Re: WILDFLY logging, files truncate upon rotation.
          Tomaz Cerar Master

          Does the same still happen on beta1?

          • 2. Re: WILDFLY logging, files truncate upon rotation.
            georgemat Newbie

            We are using Alpha3 release. Our schedule at this time doesn't allow us to try Beta1, unless we are sure that we cannot live with this current limitation.  It takes about 2 weeks for us to make a conversion to a new version of WILDFLY version.

            • 3. Re: WILDFLY logging, files truncate upon rotation.
              georgemat Newbie

              Converted the our code to run in WILDFLY BETA1 environment. I still am seeing the same behavior.

               

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

                              <formatter>

                                  <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="server.log"/>

                              <rotate-size value="50k"/>

                              <max-backup-index value="8"/>

                              <append value="true"/>

                          </size-rotating-file-handler>

               

              With the settings as above, I would expect the "server.log.(8-1) + server.log"  files with approximate size of   ( 50k * 8 = 400k) to be available over a period of time.

              Upon WILDFLY starting, it began with server.log andthen created all sever.log.(1-8) files, but over a period of time, it gets truncated to just one file server.log, with a size larger than the maximum specified value of 50k.

              • 4. Re: WILDFLY logging, files truncate upon rotation.
                James Perkins Master

                Can you paste the configuration for the entire logging subsystem? Also maybe the logging.properties file too.

                 

                --

                James R. Perkins

                • 5. Re: WILDFLY logging, files truncate upon rotation.
                  georgemat Newbie

                  Thank you.

                  Here are the logging subsystem entries and the logging.properties file contents.

                   

                  ===================logging  subsystem=============

                      <subsystem xmlns="urn:jboss:domain:logging:1.2">
                          <console-handler name="CONSOLE">
                              <level name="INFO"/>
                              <formatter>
                                  <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>
                              </formatter>
                          </console-handler>
                          <custom-handler name="DB" class="com.company.product.common.handlers.DBHandler" module="com.company.product.common">
                              <level name="INFO"/>
                              <formatter>
                                  <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>
                              </formatter>
                          </custom-handler>
                          <size-rotating-file-handler name="FILE" autoflush="true">
                              <formatter>
                                  <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>
                              </formatter>
                              <file relative-to="jboss.server.log.dir" path="server.log"/>
                              <rotate-size value="53m"/>
                              <max-backup-index value="11"/>
                              <append value="true"/>
                          </size-rotating-file-handler>
                          <size-rotating-file-handler name="RMB" autoflush="true">
                              <level name="ALL"/>
                              <formatter>
                                  <pattern-formatter pattern="(%d{yyyy-MM-dd'T'HH:mm:ss.SSSS}) %-5p [%l] (%t) %s%E%n"/>
                              </formatter>
                              <file relative-to="jboss.server.log.dir" path="RMB.log"/>
                              <rotate-size value="53m"/>
                              <max-backup-index value="11"/>
                              <append value="true"/>
                          </size-rotating-file-handler>
                          <logger category="com.company.product.ist">
                              <level name="INFO"/>
                          </logger>
                          <logger category="com.company.product.RMB">
                              <level name="INFO"/>
                              <handlers>
                                  <handler name="RMB"/>
                              </handlers>
                          </logger>
                          <logger category="com.company.product.is">
                              <level name="INFO"/>
                          </logger>
                          <logger category="com.company.product.Notification">
                              <level name="INFO"/>
                          </logger>
                          <logger category="LOGSERVICE" use-parent-handlers="false">
                              <level name="INFO"/>
                              <handlers>
                                  <handler name="FILE"/>
                                  <handler name="DB"/>
                              </handlers>
                          </logger>
                          <logger category="com.arjuna">
                              <level name="WARN"/>
                          </logger>
                          <logger category="org.apache.tomcat.util.modeler">
                              <level name="WARN"/>
                          </logger>
                          <logger category="org.apache.commons.digester.Digester.sax">
                              <level name="ERROR"/>
                          </logger>
                          <logger category="org.apache.commons.digester.Digester">
                              <level name="ERROR"/>
                          </logger>
                          <logger category="sun.rmi">
                              <level name="WARN"/>
                          </logger>
                          <logger category="jacorb">
                              <level name="WARN"/>
                          </logger>
                          <logger category="jacorb.config">
                              <level name="ERROR"/>
                          </logger>
                          <root-logger>
                              <level name="INFO"/>
                              <handlers>
                                  <handler name="CONSOLE"/>
                                  <handler name="FILE"/>
                              </handlers>
                          </root-logger>
                      </subsystem>

                   

                   

                  ===============================================

                   

                  ===================logging.properties=============

                  # Note this file has been generated and will be overwritten if a

                  # logging subsystem has been defined in the XML configuration.

                   

                   

                  # Additional loggers to configure (the root logger is always configured)

                  loggers=com.arjuna,jacorb,com.company.product.rmb,org.apache.commons.digester.Digester,com.company.product.ist,com.company.product.is,jacorb.config,com.company.product.Notification,LOGSERVICE,org.apache.commons.digester.Digester.sax,org.apache.tomcat.util.modeler,sun.rmi

                   

                  logger.level=INFO

                  logger.handlers=CONSOLE,FILE

                   

                  logger.com.arjuna.level=WARN

                  logger.com.arjuna.useParentHandlers=true

                   

                  logger.jacorb.level=WARN

                  logger.jacorb.useParentHandlers=true

                   

                  logger.com.company.product.rmb.level=INFO

                  logger.com.company.product.rmb.useParentHandlers=true

                  logger.com.company.product.rmb.handlers=RMB

                   

                  logger.org.apache.commons.digester.Digester.level=ERROR

                  logger.org.apache.commons.digester.Digester.useParentHandlers=true

                   

                  logger.com.company.product.ist.level=INFO

                  logger.com.company.product.ist.useParentHandlers=true

                   

                  logger.com.company.product.is.level=INFO

                  logger.com.company.product.is.useParentHandlers=true

                   

                  logger.jacorb.config.level=ERROR

                  logger.jacorb.config.useParentHandlers=true

                   

                  logger.com.company.product.Notification.level=INFO

                  logger.com.company.product.Notification.useParentHandlers=true

                   

                  logger.LOGSERVICE.level=INFO

                  logger.LOGSERVICE.useParentHandlers=false

                  logger.LOGSERVICE.handlers=DB,FILE

                   

                  logger.org.apache.commons.digester.Digester.sax.level=ERROR

                  logger.org.apache.commons.digester.Digester.sax.useParentHandlers=true

                   

                  logger.org.apache.tomcat.util.modeler.level=WARN

                  logger.org.apache.tomcat.util.modeler.useParentHandlers=true

                   

                  logger.sun.rmi.level=WARN

                  logger.sun.rmi.useParentHandlers=true

                   

                  handler.RMB=org.jboss.logmanager.handlers.SizeRotatingFileHandler

                  handler.RMB.level=ALL

                  handler.RMB.formatter=RMB

                  handler.RMB.properties=enabled,autoFlush,append,fileName,maxBackupIndex,rotateSize

                  handler.RMB.enabled=true

                  handler.RMB.autoFlush=true

                  handler.RMB.append=true

                  handler.RMB.fileName=C\:\\jboss\\standalone\\log\\RMB.log

                  handler.RMB.maxBackupIndex=11

                  handler.RMB.rotateSize=55574528

                   

                  handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler

                  handler.CONSOLE.level=INFO

                  handler.CONSOLE.formatter=CONSOLE

                  handler.CONSOLE.properties=enabled,autoFlush,target

                  handler.CONSOLE.enabled=true

                  handler.CONSOLE.autoFlush=true

                  handler.CONSOLE.target=SYSTEM_OUT

                   

                  handler.DB=com.company.product.common.handlers.DBHandler

                  handler.DB.module=com.company.product.common

                  handler.DB.level=INFO

                  handler.DB.formatter=DB

                   

                  handler.FILE=org.jboss.logmanager.handlers.SizeRotatingFileHandler

                  handler.FILE.level=ALL

                  handler.FILE.formatter=FILE

                  handler.FILE.properties=enabled,autoFlush,append,fileName,maxBackupIndex,rotateSize

                  handler.FILE.enabled=true

                  handler.FILE.autoFlush=true

                  handler.FILE.append=true

                  handler.FILE.fileName=C\:\\jboss\\standalone\\log\\server.log

                  handler.FILE.maxBackupIndex=11

                  handler.FILE.rotateSize=55574528

                   

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

                  formatter.RMB.properties=pattern

                  formatter.RMB.constructorProperties=pattern

                  formatter.RMB.pattern=(%d{yyyy-MM-dd'T'HH\:mm\:ss.SSSS}) %-5p [%l] (%t) %s%E%n

                   

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

                  formatter.CONSOLE.properties=pattern

                  formatter.CONSOLE.constructorProperties=pattern

                  formatter.CONSOLE.pattern=(%d{yyyy-MM-dd'T'HH\:mm\:ss.SSSS}) %-5p [%l] (%t) %s%E%n

                   

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

                  formatter.DB.properties=pattern

                  formatter.DB.constructorProperties=pattern

                  formatter.DB.pattern=(%d{yyyy-MM-dd'T'HH\:mm\:ss.SSSS}) %-5p [%l] (%t) %s%E%n

                   

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

                  formatter.FILE.properties=pattern

                  formatter.FILE.constructorProperties=pattern

                  formatter.FILE.pattern=(%d{yyyy-MM-dd'T'HH\:mm\:ss.SSSS}) %-5p [%l] (%t) %s%E%n

                   

                  ==============================================

                  • 6. Re: WILDFLY logging, files truncate upon rotation.
                    James Perkins Master

                    I just tested this on Linux and I wasn't able to see the issue at all. All I did was just added a size-rotating-file-handler to rotate on 20k and cranked up trace logging. It seems to be rotating fine for me. I'll try to give this a test on Windows when I get a chance as well.

                     

                    --

                    James R. Perkinks

                    • 7. Re: WILDFLY logging, files truncate upon rotation.
                      georgemat Newbie

                      Thank you James for following up.

                      We are running on a 64bit Windows/JVM (1.7.0_21) environment.

                      I was able to re-produce it on both Win7 and Windows 2008 R2 machines.