-
1. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
jamezp Jul 11, 2012 12:41 PM (in response to davidmac)1 of 1 people found this helpfulIn your host.xml on the servers tag add the directory-grouping="by-type" attribute.
<servers directory-grouping="by-type"> <server name="server-one" group="main-server-group" auto-start="true"/> <server name="server-two" group="main-server-group" auto-start="true"> <socket-bindings port-offset="150"/> </server> <server name="server-three" group="other-server-group" auto-start="false"> <socket-bindings port-offset="250"/> </server> </servers>
You could also execute a CLI command to change it as well.
${JBOSS_HOME}/bin/jboss-cli.sh --connect "/host=master:write-attribute(name=directory-grouping,value=by-type)"
What at attribute does is changes the way the tmp, log and data directories are created. So the log directory for server-one would be:
${JBOSS_HOME}/domain/log/servers/server-one
You can also override the jboss.server.log.dir to /var/log/jbossas or whatever you want.
--
James R. Perkins
-
2. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
davidmac Jul 11, 2012 2:48 PM (in response to jamezp)Thanks, that is very helpful. One clarification and I'll be ready to test:
Where is the proper place(s) to put the jboss.server.log.dir setting so that all the processes (host controller, process controller, server instances) will have that property correctly set to "/var/log/jbossas"? I know I can set the system property in the host.xml/servers/server scope but that won't cover the host controller and process controllers.
-
3. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
jamezp Jul 11, 2012 2:50 PM (in response to davidmac)You can either pass it as a system propertry, -Djboss.server.log.dir=/var/log, or add the system property like you suggest and edit the logging.properties file for the boot.log. Just adding it to the JAVA_OPTS in domain.conf would work too.
--
James R. Perkins
-
4. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
davidmac Jul 11, 2012 3:30 PM (in response to jamezp)Well I didn't get very far... almost nothinged work as expected BTW, this is 7.1.1 Final. I modified the logging.properties and got the boot.log file into /var/log/erp/boot.log. But...
I made the mods to host.xml shown below (only showing relevant portions):
<?xml version='1.0' encoding='UTF-8'?>
<host name="S1" xmlns="urn:jboss:domain:1.2">
<servers directory-grouping="by-type">
<server name="instance1" group="group1">
<system-properties>
<property name="com.blah" value="blah1"/>
</system-properties>
<jvm name="default">
</jvm>
</server>
</servers>
</host>
When I started the the server using ./domain.sh I got the following error:
ERROR [org.jboss.as.host.controller] (Controller Boot Thread) JBAS010907: Failed to start server (instance1) java.lang.IllegalArgumentException: No enum constant org.jboss.as.host.controller.DirectoryGrouping.by-type
A second issue is that the jboss.server.log.dir didn't seem to take effect even though it is in domain.conf:
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.d
gc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.domain.default.config=domain.xml -Djboss.host.default.config=host.xml"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=/var/log/erp"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi
# Use JBoss Modules lockless mode
#JAVA_OPTS="$JAVA_OPTS -Djboss.modules.lockless=true"
# The ProcessController process uses its own set of java options
if [ "x$PROCESS_CONTROLLER_JAVA_OPTS" = "x" ]; then
PROCESS_CONTROLLER_JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=/var/log/erp"
fi
# The HostController process uses its own set of java options
if [ "x$HOST_CONTROLLER_JAVA_OPTS" = "x" ]; then
HOST_CONTROLLER_JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=/var/log/erp"
fi
I removed the "directory-grouping" attribute from host.xml since it was erroring and tried starting with just the changes to domain.conf to test them. It didn't write the process controller or host controller log anywhere (i.e. jboss/domain/log or /var/log/erp). However, it wrote the server.log to /var/log/erp/server.log.
Any ideas on what I'm doing wrong?
-
5. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
jamezp Jul 11, 2012 4:23 PM (in response to davidmac)Well I need to apologize here. Looks like there was a bug there in how the attribute was parsed. How it passed testing, I'm not sure. It is fixed upstream, but not in any release accept EAP 6 so far. So it really is useless for you. Even worse I don't see a workaround for it other than building from source.
I forgot in domain mode you also have to add -Djboss.domain.log.dir as well.
--
James R. Perkins
-
6. Re: JBoss 7.1 Domain Mode Logging - configuring per instance log locations
davidmac Jul 11, 2012 5:23 PM (in response to jamezp)No apology necessary. I appreciate the effort. I'll figure out some workaround for now and then revisit in another few weeks. I don't have a problem building from source except not time at the present. If it still isn't working after another public release or 2 I'll build it from scratch and test.