pjd
pjd

Reputation: 1173

JBoss 7.2.0 Final creating server.log file in unexpected places

I am trying to set up JBoss 7.2.0 Final on CentOS 6.5 to handle 4 different deployments of our software. I'm not sure if I have set things up correctly or not, but everything seems to work except that server.log is not ending up where I think I am telling it to be saved in 3 of 4 deployments.

There are 4 HTTP ports being used for the deployments. They are :8080, :8180, :9876, and :9976. I don't know if that is relevant information or not, but I bring it up because in each standalone.xml file I am using the jboss.socket.binding.port-offset option to assign the ports. The only deployment that seems to work flawlessly is :8080, which has jboss.socket.binding.port-offset:0. :8180 has jboss.socket.binding.port-offset:100, etc.

Each deployment lives in its own directory, for example

/opt/jboss-eap-6.1/target/standalone8080/

and

/opt/jboss-eap-6.1/target/standalone9876/

In the standalone.xml file for each deployment (/opt/jboss-eap-6.1/target/standalone9876/configuration/standalone.xml, for example), the server log is specified in the same way:

<file relative-to="jboss.server.log.dir" path="server.log"/>

This should result in the server.log being saved in, for example, /opt/jboss-eap-6.1/target/standalone9876/log, and when redeploying the software on each port, I have echoed out the $JBOSS_LOG_DIR variable and it seems on the surface to be set correctly in each case.

However, as mentioned above, only port :8080 creates the server.log file in the expected location (/opt/jboss-eap-6.1/target/standalone8080/log).

The incorrect locations:

--Port :8180 puts its server.log file in the :8080 location. I.e., :8180 overwrites the server.log file at /opt/jboss-eap-6.1/target/standalone8080/log.

--Port :9876 puts its server.log file in /opt/jboss-eap-6.1/target/standalone/log. I.e., it creates a new folder simply called standalone and puts the file there. I will add that in a former time, the entire port :9876 deployment lived in a folder at that path (/opt/jboss-eap-6.1/target/standalone). This apparent clue makes me think there is some other place where there is a setting for the server.log file path. I could be quite wrong.

--Finally, port :9976 is putting its server.log file one level above the desired log directory, in other words, at /opt/jboss-eap-6.1/target/standalone9976.

I don't know if the way these 4 deployments are being handled is fundamentally incorrect or if there is a setting hiding somewhere that is overriding my desired paths.

I saw one poster with a similar problem say they made a change to domain.xml to fix the issue. I don't think I can do that, since I only have one domain.xml file (located in /opt/jboss-eap-6.1/domain/configuration) that is associated with all 4 deployments.

Another post recommended removing the "relative-to" bit in the <file> tag in the standalone.xml file. I tried that with port :9876 as follows:

<file path="/opt/jboss-eap-6.1/target/standalone9876/log/server.log"/>

This did not work for me. The server.log file still ended up in

<file path="/opt/jboss-eap-6.1/target/standalone/log/server.log"/>

Any ideas what I am doing wrong? Is there simply another place I need to declare my log path, or is the way these 4 servers are set up just plain incorrect?

Upvotes: 0

Views: 1571

Answers (1)

James R. Perkins
James R. Perkins

Reputation: 17780

Have a look at each logging.properties file in each configuration directory. You might just need to update those, once, to change the path to {jboss.server.log.dir}/server.log. Then when you start each server you'll need to specify the jboss.server.log.dir directory.

./bin/standalone.sh -Djboss.server.log.dir=$JBOSS_HOME/target/standalone8080/log

There might be a clever way to handle it in the $JBOSS_HOME/bin/standalone.conf file.

Upvotes: 2

Related Questions