Skip to main content

TraceFacility ... How to use?

5 replies [Last post]
maretzke
Offline
Joined: 2004-10-04

Hello all,

I wonder where my trace messages are send to ... Has anybody a quick example on how I can receive the trace messages from the Trace Facility and show them on the console?

Currently, I trace like this (after looking up the trace facility from JNDI):

traceFacility.createTrace(id, level, "BounceSbb", message, System.currentTimeMillis());

Any ideas?

-- Michael

Message was edited by: maretzke

Ah, forgot: The scope of my tracing activities is inside a Sbb ...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous

Use this mail:
marco-f-monteiro@ptinovacao.pt

I've tried to change my profile in java.net but it still keeps the old mail!

Thanks.

mranga
Offline
Joined: 2003-06-06

Please consider posting a little nicely packaged how to wiki when this is figured out.

Ranga

Anonymous

Hi Michael,
Any news about this?

I'm having the same problem. I've changed the log4j.xml file in /server/all/conf, and put the Threshold value to DEBUG and still don't see my logs printed.

In the code I'm doing this:
public void setSbbContext(){
...
traceFacility = (TraceFacility) myEnv.lookup("slee/facilities/trace");
...
}
...
public final void trace(Level level, String message) {
try {
traceFacility.createTrace(id, level, traceType, message, System.currentTimeMillis());
} catch (Exception e) {
System.err.println("Exception while tracing: " + e.toString());
}
}

And then I call this method like this:
trace(Level.INFO, "My message!!!");

Any ideas?

I've also tried to set the trace level by the JMX console in TraceMBean but still nothing!

Regards,
Marco

mranga
Offline
Joined: 2003-06-06

Marco,

How do you register your trace listener? In the tck you you will find examples. I will mail you some code for a jmx trace listener that Fran wrote up. maybe of help. Look in your mail in a few hours when i will get around to it.

Ranga

Message was edited by: mranga

ivelin
Offline
Joined: 2003-07-13

The TCK has several trace facility tests. Have you looked at them? Trace messages should be sent to the console and also JMX notifications.

Ivelin