Cloud CM-IPMP Instrukcja Naprawy Strona 93

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 201
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 92
public void setSbbContext( SbbContext context ) {
this.context =
try {
final Context c = (Context)new InitialContext().lookup("java:comp/env/slee");
traceFacility = (TraceFacility)c.lookup("facilities/trace");
} catch( NamingException e ) { }
}
Then, in the SBB, the trace facility is used to create the trace message:
...
traceFacility.createTrace( context.getSbb(), Level.WARNING,
"sbb.com.opencloud.mysbb", "this is a trace message",
System.currentTimeMillis() );
...
Service developers may find it useful to create a utility method to make trace method calls more concise.
More details about the trace facility, including the trace facility API, is available in the JAIN SLEE specification version 1.0.
13.3 Notification Recorder M-Let
The Rhino SLEE includes an m-let which listens for notifications from the SLEE and from the Alarm and Trace facilities and
records them to the Rhino SLEE logging subsystem on the
notificationrecorder
log key. The m-let is installed by default
with the following entry in $RHINO_NODE_HOME/config/pernode-mlet.conf.
<mlet>
<classpath>
<jar>
<url>file:@RHINO_HOME@/lib/notificationrecordermbean.jar</url>
</jar>
</classpath>
<class>com.opencloud.slee.mlet.notificationrecorder.NotificationRecorder</class>
</mlet>
13.3.1 Configuration
By default, the notification recorder is configured to write all notifications it receives to the Log4J log key “notificationrecorder”.
These log messages will then be processed by Rhino’s logging system.
To separate the notification recorder’s output from the rest of the Rhino logs, the logging system can be configured to send all
log messages for the key “notificationrecorder” to a particular logging appender. Detailed information on the configuration of
Rhino’s logging system is available in Chapter 10.
To create a new logging appender (in this case, a file appender), do the following:
[Rhino@localhost (#1)] createfileappender myFileAppender myfileappender.log
This appender, named “myFileAppender”, will write all output to the file “myfileappender.log” in the
rhino/work/log
direc-
tory.
For the sake of example, only trace messages will be sent to the log. To achieve this, all log messages from the log key
“notificationrecorder.trace” will be sent to the logging appender that has just been created:
[Rhino@localhost (#2)] addappenderref notificationrecorder.trace myFileAppender
Now when an SBB calls the trace method of the Trace Facility, the created messages will appear in the above file.
Open Cloud Rhino 1.4.3 Administration Manual v1.1 84
Przeglądanie stron 92
1 2 ... 88 89 90 91 92 93 94 95 96 97 98 ... 200 201

Komentarze do niniejszej Instrukcji

Brak uwag