tags:

views:

210

answers:

2

On startup JGroups 2.7.0. GA writes to System.out a message along the lines of:

---------------------------------------------------------
GMS: address is 10.0.3.35:48641 (cluster=blabla)
---------------------------------------------------------

I want to either suppress it or redirect it using Log4j ( which the rest of the framework uses ).

Ideas?


I don't want to redirect System.out by itself since that usually causes more trouble than it's worth.

A: 

You can't redirect System.out to log4j that makes no sense. After all how would log4j print anything ? It would get stuck in a loop.

mP
Thanks for the answer. What I meant was not redirecting System.out - I specified that, but redirect that single JGroups message.
Robert Munteanu
There is some shenanigans going on with STDOUT in JBoss. When you print something to System.out, you get a log entry in the log4j log like "15:32:51,919 [] INFO [STDOUT] blah blah". So *something* is redirecting stdout and assigning it to a dedicated log4j category.
skaffman
@SkaffmanWhat i meant is since the original real undecorated handle to Sysout is wrapped its a mess to attempt to capture Sys.out prints. After all where would you print them - to itself which result in that being caught again - etc... it doesnt end. If you had the original Sysout then one could do whatever.Its not hard to capture Sysout prints simply replace the original but its important to keep a handle on the original so you can print to it when you so wish.
mP
+2  A: 

You can suppress the printing of the GMS address by setting in your XML

<pbcast.GMS print_local_addr="false" ...>

Works on JGroups 2.5.1 as well.

Howard