Java – How to change Jboss’ logging directory

javajboss

I'm running jboss-as 7.2. I'm trying to configure all log files to go to /var/log/jboss-as but only the console log is going there. I'm using the init.d script provided with the package and it calls standalone.sh. I'm trying to avoid having to modify startup scripts.

I've tried adding JAVA_OPTS="-Djboss.server.log.dir=/var/log/jboss-as" to my /etc/jboss-as/jboss-as.conf file but the init.d script doesn't pass JAVA_OPTS to standalone.sh when it calls it.

The documentation also says I should be able to specify the path via XML with the following line in standalone.xml:

<path name="jboss.server.log.dir" path="/var/log/jboss-as"/>

However, it doesn't say where in the file to put that. Every place I try to put it causes JBoss to crash on startup saying that it can't parse the standalone.xml file correctly.

Best Answer

You can specify the path of your log files via the standalone.sh file. If you look at the org.jboss.as.logging subsystem, you will see the configuration there.

Related Topic