-
1. Re: how to configure custom log location in managed domain?
wdfink Mar 22, 2012 3:36 PM (in response to hsr)Did you change
<file relative-to="jboss.server.log.dir" ...
within the logging subsystem of the correct profile in domain.xml?
-
2. Re: how to configure custom log location in managed domain?
hsr Mar 23, 2012 12:29 PM (in response to wdfink)Thanks for reply. I did not try to change this property but earlier I tried to set a system property 'jboss.server.log.dir" in correct profile in server group section ( as shown below)
<system-properties>
<property name="jboss.server.log.dir" value="/logs/WSD/jbossdomain_7/managed "/>
</system-properties>
which obviously did not work. Upon your suggestion I changed to the value and the log file was created at specified location as shown below:
<file relative-to="jboss.server.log.dir" path="/logs/jbossdomain_7/managed/server.log"/>
is there not way that I can setup log file location for each server. Does this mean that I will need as many profiles as servers?
i just wanted to find a way where I can setup custom location for all of server log files, which should be easy to configure but somehow I am not able to get it.
Thanks again for the response. -
3. Re: how to configure custom log location in managed domain?
nevencvetkovic May 2, 2012 4:27 AM (in response to hsr)James,
Try redefining jboss.server.log.dir for each server, e.g.
<servers>
<server name="server-one" group="main-server-group">
<paths>
<path name="jboss.server.log.dir" path="/var/log/jbossdomain/serverone" />
</paths>
</server>
<server name="server-two" group="main-server-group" auto-start="true">
<paths>
<path name="jboss.server.log.dir" path="/var/log/jbossdomain/servertwo" />
</paths>
<socket-bindings port-offset="150"/>
</server>
<server name="server-three" group="other-server-group" auto-start="false">
<paths>
<path name="jboss.server.log.dir" path="/var/log/jbossdomain/serverthree" />
</paths>
<socket-bindings port-offset="250"/>
</server>
</servers>
You should be able to redefine the path in your servers, according to https://docs.jboss.org/author/display/AS71/General+configuration+concepts
Only (first five) the following entries are not allowed to be redefined:
- jboss.home
- user.home
- user.dir
- java.home
- jboss.server.base.dir
See if that helps.
-
4. Re: how to configure custom log location in managed domain?
mccloud May 23, 2012 8:27 AM (in response to nevencvetkovic)This configuration is almost correct. You can't override the 'jboss.server.log.dir' in your server configuration as it is a reserved property. What you can do however is define a path with the name 'my.jboss.server.log.dir' in your server configuration (i.e. in your server config in your host-controller) and configure this as the 'relative-to' property of the '<file .....>' configuration of the logging subsystem in your profile (i.e. domain.xml).
Hope this helps.
-
5. Re: how to configure custom log location in managed domain?
nevenc May 23, 2012 11:01 AM (in response to mccloud)Thanks for clarification Duncan.
I've quickly tested both my and your ideas:
You are correct, we can't override "jboss.server.log.dir" in the domain.xml/host.xml.
Your suggestion works great, but it doesn't completely solve our problem.
Let's start with virgin install of JBoss AS7.
By default, out-of-the-box, domain mode generates the following log files:
- JBOSS_HOME/domain/log/host-controller.log
- JBOSS_HOME/domain/log/process-controller.log
- JBOSS_HOME/domain/servers/server-one/log/server-one/log/boot.log
- JBOSS_HOME/domain/servers/server-one/log/server-one/log/server.log
- JBOSS_HOME/domain/servers/server-one/log/server-two/log/boot.log
- JBOSS_HOME/domain/servers/server-one/log/server-two/log/server.log
Location of files (1) and (2) can be customized by adding lines to JBOSS_HOME/bin/domain.conf file:
if [ "x$JBOSS_LOG_DIR" = "x" ]; then
JBOSS_LOG_DIR=/tmp/jbossdomain/controllers # host-controller.log and process-controller.log
fi
Location of files (4) and (6) can be customized by editing domain.xml and host.xml files (as Duncan suggested):
JBOSS_HOME/domain/configuration/domain.xml:
<profiles>
<profile name="default">
<subsystem xmlns="urn:jboss:domain:logging:1.1">
...
<periodic-rotating-file-handler name="FILE">
...
<file relative-to="custom.jboss.server.log.dir" path="server.log"/> # server.log name is defined here
...
</periodic-rotating-file-handler>
</subsystem>
...
</profile>
...
</profiles>
JBOSS_HOME/domain/configuration/host.xml:
<servers>
<server name="server-one" group="main-server-group">
<paths>
<path name="custom.jboss.server.log.dir" path="/tmp/jbossdomain/server-one" />
</paths>
</server>
<server name="server-two" group="main-server-group" auto-start="true">
<paths>
<path name="custom.jboss.server.log.dir" path="/tmp/jbossdomain/server-two" />
</paths>
<socket-bindings port-offset="150"/>
</server>
<server name="server-three" group="other-server-group" auto-start="false">
<paths>
<path name="custom.jboss.server.log.dir" path="/tmp/jbossdomain/server-three" />
</paths>
<socket-bindings port-offset="250"/>
</server>
</servers>
Of course, the "boot.log" is configured in the JBOSS_HOME/domain/configuration/logging.properties:
handler.FILE.fileName=${org.jboss.boot.log.file:boot.log}
We can write everything to a same boot.log file, but we can't configure the location of boot.log per appserver process.
I need to play with this longer to figure out how to do this. It seems it is an overkill, but we could try passing in JVM OPTIONS for each JVM appserver, e.g. "-Dorg.jboss.boot.log.file=/tmp/jbossdomain/server-one/boot.log"
Any suggestions?
-
6. Re: how to configure custom log location in managed domain?
nevenc May 24, 2012 8:38 AM (in response to nevenc)Also,
Take a look at the "ps -ef | grep java" and see what actually made it to JAVA_OPTS for 4 java processes (host-controller, process-controller, server-one, server-two).
Cheers!
-
7. Re: how to configure custom log location in managed domain?
kingakoopa Jun 29, 2013 7:20 PM (in response to nevenc)Hello Neven & Folks,
I know its been a long time since there was a post on this thread.
I wanted to know if you were able to figure out how to make boot.log and host-controller.log & process-controller.log configured to point to a custom location?
I configured my Server.log location in JBOSS_HOME/domain/configuration/domain.xml:( And its WORKS !!!)
<profiles>
<profile name="default">
<subsystem xmlns="urn:jboss:domain:logging:1.1">
...
<periodic-rotating-file-handler name="FILE">
...
<file relative-to="custom.jboss.server.log.dir" path="/tmp/logs/server.log"/> # server.log name is defined here
...
</periodic-rotating-file-handler>
</subsystem>
...
</profile>
...
</profiles>
For host-controller.log and process-controller.log , i made changes in the domain.sh file and it works fine but as soon as i touch boot.log , i made the change in the JBOSS_HOME/domain/configuration/logging.properties:
handler.FILE.fileName=${org.jboss.boot.log.file:/tmp/logs/boot.log},
the process and host log files disappear
Any help in figuring this out is monumentally appreciated.!!!!!!!!!!!!!!!
Sincerely,
KK
-
8. Re: how to configure custom log location in managed domain?
kingakoopa Jul 9, 2013 2:47 PM (in response to kingakoopa)Anyone?