0 Replies Latest reply on Aug 24, 2015 9:32 AM by mohab elamry

    how to create JBOSS 7 Dynamic Log file with rotating file handler

    mohab elamry Newbie

      hi everyone,

      i am trying to configure JBOSS 7 to log in dynamic file name (dd-mm-yyyy.log) plus size rotating file handler. i mean i want the file to only grow up to 50 MB before adding index ( 1,2,3,4) then the next day the log file name should be new file name with dd-mm-yyyy and start again the index.

      example for output

      24-08-2015-1.log

      24-08-2015-2.log

      25-08-2015-1.log

      25-08-2015-2.log

      any help how to obtain that ? below is my configuration file

      <console-handler name="CONSOLE">
         <level name="INFO"/>
         <formatter>
         <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
         </formatter>
         </console-handler>
         <size-rotating-file-handler name="FILE" autoflush="true">
         <formatter>
         <pattern-formatter pattern="%z{utc}%d{dd/MM/yyyy HH:mm:ss,SSS} %-5p [%c] %s%E%n"/>
         </formatter>
         <file relative-to="jboss.server.log.dir" path="${%d{HH-mm-ss-SSS}}.log"/>
         <rotate-size value="5K"/>
         <max-backup-index value="10"/>
      
         <append value="true"/>
         </size-rotating-file-handler>
      
      

       

      thanks for your support