3 Replies Latest reply on Aug 4, 2014 4:25 PM by James Perkins

    Logging size-rotating-file-handler suffix

    Matthew Segreti Newbie

      Is it possible to mark a size-rotating-file-handler with a suffix other than the default .1, .2, .3 etc?

        • 1. Re: Logging size-rotating-file-handler suffix
          James Perkins Master

          Not the default one. You'd have to extend it to change the suffix. What were you looking for?

           

          There is a periodic-size-rotating-file-handler in WildFly Core. It hasn't been released yet, but it will be in WildFly 9. You can use it as a custom-handler if you specify the module org.jboss.logmanager and the class org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler.

           

          --

          James R. Perkins

          • 2. Re: Logging size-rotating-file-handler suffix
            Matthew Segreti Newbie

            I am looking for a size rotating file handler because my log gets pretty big and is difficult to maintain so this is what drove me to use the size rotating. Originally, I had it setup as a periodic rotating file handler which created a new log every day which is functionality I would like to keep. Unfortunately, I am not using WildFly 9 I am using EAP 6.2. Would a custom handler give me the control I want to have?

            • 3. Re: Re: Logging size-rotating-file-handler suffix
              James Perkins Master

              The handler already exists in the org.jboss.logmanager module. You can use it as a custom-handler if you'd like. The addition of it in WildFly 9 is just the resource will be added for ease of configuration.

               

              You can use the following CLI command to create a PeriodicSizeRotatingFileHandler as a custom handler.

               

              /subsystem=logging/custom-handler=fh:add(class=org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler,module=org.jboss.logmanager,properties=[append=true,suffix=".yyyy-MM-dd",autoFlush=true,fileName="${jboss.server.log.dir}/fh.log",maxBackupIndex=5,rotateSize=25000000])
              

               

              --

              James R. Perkins