3 Replies Latest reply on Jul 24, 2006 9:35 AM by jaikiran

    rotate logs while jboss is running

    peter74

      Is it possible to rotate the jboss logs, without restarting jboss?

      The moment I remove the contents of the file (server.log) by editing, jboss stops writing to it.

      OS -RHEL 4.0
      JBoss - jboss-3.2.7


      Thanks
      Peter

        • 1. Re: rotate logs while jboss is running
          jaikiran

           

          Is it possible to rotate the jboss logs, without restarting jboss?


          Just touch the log4j.xml file(so that its last modified timestamp changes) and save the same. There is a Log4jTimerTask which will run every 60 seconds and it will pick up the changes. You will *not* have to restart the server

          • 2. Re: rotate logs while jboss is running
            peter74


            Thanks Jaikiran,

            But I didn't quite understand by 'save the same', you just need to touch the file right. No changed on the server.log right?
            Just touch the log4j.xml file(so that its last modified timestamp changes) and

            save the same
            .



            • 3. Re: rotate logs while jboss is running
              jaikiran

              I meant, open the log4j.xml in a text editor and just do a save(you need not do any changes to the contents of the file). This will change the last modified time of the log4j.xml file and the Log4jTimerTask will pick up this change(in its next scheduled interval of 60 seconds)