4 Replies Latest reply on Apr 1, 2010 3:11 AM by thomas2008ch

    How to force the server.log rotate?

    thomas2008ch

      Background to my question:

       

      We have a monitoring tool waching the server.log. Everytime if there is an exception appears in the server.log it will send out an alert. The problem is: after the problem which causes the exception is fixed, the monitoring tool will keep sending out alert since the exception message still stay in the server.log. In this case we want to force the server.log to rotate so that there is no exception message in the server.log.

       

      Till now I did as follow:

      stop the jboss as

      rename the server.log or even delete it

      restart the jboss as so that a new server.log is cerated.

       

      I am not sure if there is another better way to do this.

        • 1. Re: How to force the server.log rotate?
          jaikiran

          Thomas Chang wrote:

           

          Background to my question:

           

          We have a monitoring tool waching the server.log. Everytime if there is an exception appears in the server.log it will send out an alert. The problem is: after the problem which causes the exception is fixed, the monitoring tool will keep sending out alert since the exception message still stay in the server.log.

          I think the best thing to do is to fix that monitoring tool to avoid sending out repeated events for the earlier exception.

           

          Thomas Chang wrote:

           


          Till now I did as follow:

          stop the jboss as

          rename the server.log or even delete it

          restart the jboss as so that a new server.log is cerated.

           

           

           

          You don't have to restart the server.  Which version of JBoss AS do you use? For AS-5 and earlier, there's a MBean which exposes a reconfigure operation which you can use (assuming you have set "append" attribute of the server.log appender  to false).

          • 2. Re: How to force the server.log rotate?
            thomas2008ch

            I still use Jboss AS 4 and the "append" attribute of the server.log appender is set to true. I can change this at once.

             

            But how can I rotate the server.log?

            • 3. Re: How to force the server.log rotate?
              jaikiran

              Go to jmx-console (example: http://localhost:8080/jmx-console). Under jboss.system domain you will find a MBean named service=Logging,type=Log4jService. Click on that link and you will be shown a page which lists the operations that can be performed on that MBean. You will find a reconfigure() operation (the one which does not take any params). Click on the "Invoke" button beside it.

              • 4. Re: How to force the server.log rotate?
                thomas2008ch

                Many thanks.