View Single Post
  #1 (permalink)  
Old 02-18-2008
joshmoore joshmoore is offline
Registered User
 
Name: Josh Moore
Organization: Glencoe Software, Inc.
Project: OMERO, http://trac.openmicroscopy.org.uk/omero
 
Join Date: Feb 2007
Location: Germany
Posts: 99
Logging Java process with IceGrid

I'm having difficulty properly capturing the standard out of a Java process in IceGrid. I'm currently using log4j via commons-logging.

When I run "java -jar blitz.jar --Ice.Config=..." from the command line I get logging to standard out via the log4j ConsoleAppender.

When IceGrid starts my server, with :
Code:
IceGrid.Node.Output=var/log
Ice.StdOut=var/log/master.out
Ice.StdErr=var/log/master.err
then initially logging of my server goes to master.out until the communicator is started and then all output ceases. (Only exceptions logged by the Ice runtime are printed to Blitz-0.err.)

Removing Ice.StdOut and Ice.StdErr makes no difference.

Setting IceGrid.Node.RedirectErrToOut=1 makes no difference.

Removing IceGrid.Node.Output does did make a difference in that standard out from the Blitz server continues being sent to master.out.

How do I properly capture the output from the server process in var/log/Blitz-0.out?


First, the server template:
Code:
    <server-template id="BlitzTemplate">
      <parameter name="index"/>
      <parameter name="exe"  default="java"/>
      <parameter name="mx"   default="256"/>
      <parameter name="port" default="8787"/>
      <server id="Blitz-${index}" exe="${exe}" activation="always">
        <target name="debug">
          <option>-Xdebug</option>
          <option>-Xrunjdwp:server=y,transport=dt_socket,address=${port},suspend=n</option>
        </target>
        <option>-Xmx${mx}m</option>
        <option>-jar</option>
        <option>blitz/blitz.jar</option>
        <adapter name="BlitzAdapter" replica-group="BlitzAdapters" register-process="true" endpoints="tcp"/>
        <properties>
          <property name="Ice.ThreadPool.Client.Size" value="2"/>
          <property name="Ice.ThreadPool.Client.SizeMax" value="50"/>
          <property name="Ice.ThreadPool.Server.Size" value="10"/>
          <property name="Ice.ThreadPool.Server.SizeMax" value="100"/>
        </properties>
      </server>
    </server-template>
Then the node configuration:
Code:
# Registry properties
IceGrid.Registry.Client.Endpoints=tcp -p 4061
IceGrid.Registry.Server.Endpoints=tcp
IceGrid.Registry.Internal.Endpoints=tcp
IceGrid.Registry.SessionManager.Endpoints=tcp
IceGrid.Registry.Data=var/registry
IceGrid.Registry.AdminPermissionsVerifier=IceGrid/NullPermissionsVerifier

# Node properties
IceGrid.Node.Endpoints=tcp
IceGrid.Node.Name=master
IceGrid.Node.Data=var/master
IceGrid.Node.Output=var/log
IceGrid.Node.CollocateRegistry=1
#IceGrid.Node.RedirectErrToOut=1

Ice.StdOut=var/log/master.out
Ice.StdErr=var/log/master.err
The generated server config:
Code:
# Configuration file (02/18/08 10:43:30.849)

# Server configuration
Ice.ServerId=Blitz-0
Ice.ProgramName=Blitz-0
# Object adapter BlitzAdapter
BlitzAdapter.Endpoints=tcp
BlitzAdapter.AdapterId=Blitz-0.BlitzAdapter
BlitzAdapter.ReplicaGroupId=BlitzAdapters
BlitzAdapter.RegisterProcess=1
# Server descriptor properties
Ice.ThreadPool.Client.Size=2
Ice.ThreadPool.Client.SizeMax=50
Ice.ThreadPool.Server.Size=10
Ice.ThreadPool.Server.SizeMax=100
Ice.StdErr=var/log/Blitz-0.err
Ice.StdOut=var/log/Blitz-0.out
Ice.Default.Locator="IceGrid/Locator" :tcp -p 4061
Reply With Quote