|
|
|
|||||
|
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 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>
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 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 |
|
||||||
|
Hi Josh,
The Ice communicator redirects the standard output and error when the communicator is initialized. I suspect the log4j output isn't correctly re-directed to the file when this occurs. This is most likely because this log4j bug if you use an old log4j version or because you need to set the follow parameter to true in the log4j configuration (see also this link). Cheers, Benoit. |
|
|||||
|
Thanks, Benoit.
Understood. "follow" did make all logging post-communicator creation log to the proper file. My assumption was that icegridnode did the redirection, which lead to my confusion. This means there's no solution for (or perhaps better put it's not a bug that) the log output from before the Ice.Communicator creation goes to master.out whereas that after creation goes to Blitz-0.log. If I'm wrong, please let me know, because it's important to have all the logging in a single file. If not possible, I will revert to not using "IceGrid.Node.Output" (and optionally setting Ice.StdOut/Ice.Stderr manually on the other servers). Thanks again. ~Josh |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thread dump when Java server is stopped by IceGrid | mefoster | Bug Reports | 1 | 01-29-2007 06:04 PM |
| Environment variables for java IceBoxin IceGrid | Sameerrele | Help Center | 4 | 10-10-2006 06:24 PM |
| IceBox hosting java services in IceGrid | Sameerrele | Help Center | 5 | 08-21-2006 11:56 AM |
| Icegrid java icebox service | xdm | Help Center | 6 | 01-09-2006 04:59 AM |
| starting "ice" process (node/admin etc) via Java | BobDeAnna | Help Center | 6 | 01-04-2005 10:26 AM |