2 Replies Latest reply on Nov 26, 2010 4:22 AM by mario.fernandes

    Logging with delay

    mario.fernandes

      Hello everybody,

       

      I'm quite new to the Jboss AS, so I apologize beforehand for my ignorance.

       

      In my current project, the logging is divided among files depending whether it's on the business interface or on the web interface. Although I manage to do this, the logging takes a while to occur. I did not find a pattern for this, whether it was 5m or a specific ammount of lines, I didn't seem to find a pattern for it.

       

      I assume the logging is being cached and then printed, in my case for example, as soon as I shutdown the server or change the jboss-logging.xml (for example), all of the logging is printed to the file.

       

      So my question is quite a simple one, is there any way to disable this caching so that logging happens on-the-fly?

       

      The AS version I am using is 6.0M5.

       

      Here is the portion of my jboss-logging.xml regarding the specific logger I'm talking about.

       

      <size-rotating-file-handler 
           file-name="${jboss.server.log.dir}/logBusiness.log" 
           name="businessHandler" 
           autoflush="false" 
           append="true" 
           rotate-size="10M" 
           max-backup-index="5"> 
       
           <error-manager> 
               <only-once/> 
           </error-manager> 
       
            <formatter> 
               <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/> 
            </formatter> 
      </size-rotating-file-handler>
      
      <logger category="logger.business"> 
       <level name="ALL" /> 
        <handlers> 
         <handler-ref name="businessHandler"/> 
        </handlers>
      </logger>
      

       

      Thank you very much in advance.

        • 1. Re: Logging with delay
          jaikiran

          Mário Fernandes wrote:

           

          Hello everybody,

           

          I'm quite new to the Jboss AS,


          Welcome to the forum

           

           

          <size-rotating-file-handler 
               file-name="${jboss.server.log.dir}/logBusiness.log"
               name="businessHandler"
               autoflush="false"
               append="true"
               rotate-size="10M"
               max-backup-index="5">

          Try  setting that autoflush to true.

          • 2. Re: Logging with delay
            mario.fernandes

            Hello Jaikiran Pai,

             

            Thank you for the warm welcome

             

            Unfortunatly i've already tried it with the autoflush set to true and false.