[EMAIL PROTECTED] wrote:

How to activate JavaGroups tracing in JBoss?
Can we get some attributes set in cluster-config.xml or something, similar
to the ones placed in javagroups.properties file, to have the tracing
messages enabled?

You can use log4j. Scott wrote a log4j adapter some time ago. See the code in ClusterPartition.createService() (see below). You should be able to create a log4j.xml or log4j.properties based on the code below.
Cheers,



protected void createService()
throws Exception
{
boolean debug = log.isDebugEnabled();

if (debug) {
log.debug("Creating JavaGroups JChannel");
}
this.channel = new org.javagroups.JChannel(jgProps);
channel.setOpt(Channel.GET_STATE_EVENTS, new Boolean(true)); channel.setOpt(Channel.AUTO_RECONNECT, new Boolean(true));
channel.setOpt(Channel.AUTO_GETSTATE, new Boolean(true));

// Force JavaGroups to use log4j
Logger category = Logger.getLogger("org.javagroups."+partitionName);
Level priority = category.getEffectiveLevel();
/* Set the JavaGroups Trace level based on the log4j Level. The mapping
is:
Log4j Level JavaGroups Trace
TRACE DEBUG
DEBUG INFO
INFO INFO
ERROR ERROR
WARN WARN
FATAL FATAL

The JavaGroups TRACE.DEBUG level is not used as its too verbose
for our notion of DEBUG.
*/
int traceLevel = Trace.INFO;
if( priority.toInt() < Level.DEBUG.toInt() )
traceLevel = Trace.DEBUG;
else if ( priority == Level.DEBUG )
traceLevel = Trace.INFO;
else if ( priority == Level.INFO )
traceLevel = Trace.INFO;
else if ( priority == Level.ERROR )
traceLevel = Trace.ERROR;
else if ( priority == Level.WARN )
traceLevel = Trace.WARN;
else if ( priority == Level.FATAL )
traceLevel = Trace.FATAL;
LoggerWriter log4jWriter = new LoggerWriter(category, priority);
Trace.setDefaultOutput(traceLevel, log4jWriter);
Trace.setAutoFlushAll(true); // set if properties are read from file
Trace.setAutoFlushDefault(true);
log.info("Set the JavaGroups logging to log4j with category:"+category
+", priority: "+priority+", JavaGroupsLevel: "+traceLevel);

if (debug) {
log.debug("Creating HAPartition");
}
partition = new HAPartitionImpl(partitionName, channel, deadlock_detection, getServer());

if (debug) {
log.debug("Initing HAPartition: " + partition);
}
partition.init();
if (debug) {
log.debug("HAPartition initialized");
}
}

--
Bela Ban
http://www.javagroups.com
Cell: (408) 316-4459



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Reply via email to