Ok, so I see two questions now.
1) How do I move the log directory?
2) How do I move the work directory?

>From what I've found, changing the log directory is a lot harder than it needs 
>to be.  There are two log files JBoss creates: boot.log and server.log.  
>server.log is defined in myserver/conf/log4j.xml.  boot.log is defined in 
>bin/run.jar#log4j.properties.  As you've noticed, there's not a simple system 
>property you can change to move these files.  The log directory by default is 
>defined as ${jboss.server.home.dir}/log.  Since you want to share the server 
>directory, you can't change jboss.server.home.dir to be differrent for each 
>instance.

To fix server.log, modify myserver/conf/log4j.xml:

  |       <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
  | 
to

  |       <param name="File" value="${myserver.log.dir}/server.log"/>
  | 
Now change your startup command to:

  | run.sh -c myserver -Djboss.server.temp.dir=/tmp/myserver 
-Dmyserver.log.dir=/path/to/log/dir
  | 
That should take care of server.log.

Changing boot.log is a little tricker.  You will need to extract 
log4j.properties from run.jar and place it somewhere shared by both servers.  
Change the file location in log4j.properties as you did for server.log:

  | log4j.appender.FILE.File=${jboss.server.home.dir}/log/boot.log
  | 
to

  | log4j.appender.FILE.File=${myserver.log.dir}/boot.log
  | 
Now change your startup command to:

  | run.sh -c myserver -Djboss.server.temp.dir=/tmp/myserver 
-Dmyserver.log.dir=/path/to/log/dir 
-Dlog4j.configuration=file:/path/to/custom/log4j.properties
  | 
That should take care of both log files.  Didn't I say this was harder than it 
needs to be?  If anyone knows of a better way, please educate the rest of us!

Changing the work directory involves changing a tomcat config.  Modify 
myserver/deploy/jbossweb-tomcat55/server.xml:

  |          <Host name="localhost"
  |             autoDeploy="false" deployOnStartup="false" deployXML="false">
  | 
to

  |          <Host name="localhost"
  |             autoDeploy="false" deployOnStartup="false" deployXML="false" 
workDir="${jboss.server.temp.dir}/work">
  | 
Now the work directory will be based off the temp directory, which you have 
already changed to be different for each instance. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3901251#3901251

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3901251


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to