4 Replies Latest reply on Feb 29, 2012 1:11 PM by webmonkey8

    How do I change the log file output location??

    webmonkey8

      Hello,

       

      how can I change the output location of my log files in JBoss Application Server?

       

      I've read that this can be configured In the "jboss-log4j.xml" file.  I currently have the log files defaulted to: <param name="File" value="${jboss.server.log.dir}/server.log"/>

       

      I have 2 physical hard drives on the server.  How can I change the output location to another drive and folder on the same server?  Eg.,  F:\logs

      I'm not too sure of the syntax here.

       

      Also, do I need to restart JBoss AS after making this change?

       

      The main reason for wanting to do this is because these logs are growing quite huge and are taking up enormous amounts of disk space on the C: drive.

       

      Attached is the "jboss-log4j.xml" file.

       

      Thanks.

        • 1. Re: How do I change the log file output location??
          peterj

          You do not need to change the jboss-log4j.xml file, instead simply set the jboss.server.log.dir property to the location you want. For example, start the app server like this:

           

          run -Djboss.server.log.dir=d:/jbosslogs

           

          Then the server.log files will go into the d:/jbosslogs directory.

           

          Of course, you can change the jboss-log4j.xml file if you want, using: <param name="File" value="d:/jbosslogs/server.log"/>

           

          If you change the jboss-log4j.xml file, the change should be automatically picked up, but I can't recall the time delay on that, I think it is an hour.

          • 2. Re: How do I change the log file output location??
            webmonkey8

            Thank you, Peter.

             

            I will try changing the parameters in the "jboss-log4j.xml" file.  By the way, is there a way to turn off logging altogether?

            • 3. Re: How do I change the log file output location??
              peterj

              I suspect that if you remove the file that the logging will not happen (I have't tried this so am not certain).

               

              You could also set the threshold to ERROR (or WARN), that way only error messages would show in the log.

               

              You could also use a rolling file appender with a limit on the size, and a limit on the number of logs to keep. That is usually the best way to limit log sizes. Any turorial on Log4J should show you how.

              • 4. Re: How do I change the log file output location??
                webmonkey8

                Thank you, Peter!