Oracle Server E10293-02 Benutzerhandbuch
Tracing and Logging Mechanism
B-10
Oracle Communication and Mobility Server Developer’s Guide
"
<vendor id=\
"
10415\
"
name=\
"
3GPP\
"
>\n
"
+
"
</vendor>\n
"
+
"
<application id=\
"
3\
"
name=\
"
Rf\
"
vendor=\
"
3GPP\
"
\n
"
+
"
service-type=\
"
Acct\
"
>\n
"
+
"
<command name=\
"
Accounting\
"
code=\
"
271\
"
/>\n
"
+
"
</application>\n
"
+
"
</dictionary>\n
"
;
//--> Apply new extension to current dictionary
try {
myStack . extendGrammar(myDictionary);
} catch (DiameterException e) {
// Handle dictionary syntax errors ...
}
For increased flexibility in a real application, you may want to read the XML syntax
description from a file rather than having it embedded in the Java source code. This
way, it becomes possible to change the mapping between names and codes without
recompiling the application.
description from a file rather than having it embedded in the Java source code. This
way, it becomes possible to change the mapping between names and codes without
recompiling the application.
The 3GPP Rf Interface dictionary is returned by getRfDictionary() and the 3GPP
Ro
Ro
Interface dictionary is returned by getRoDictionary() and can be extended by
the Diameter stack.
Tracing and Logging Mechanism
The DiameterTraceLoggerListener class is an interface to the Diameter tracing
and logging mechanism. This interface represents the communication channel
implemented by an application to receive debug traces and logs from the Diameter
stack implementation. Logs are messages targeted to the user of DiameterStack.
Traces are for internal use and are meaningful only to people with a good knowledge
of the DiameterStack implementation.
and logging mechanism. This interface represents the communication channel
implemented by an application to receive debug traces and logs from the Diameter
stack implementation. Logs are messages targeted to the user of DiameterStack.
Traces are for internal use and are meaningful only to people with a good knowledge
of the DiameterStack implementation.
All the messages that may be sent through the
DiameterTraceLoggerListener.log()
DiameterTraceLoggerListener.log()
logging interface are defined in
LogMessages.def
. There is no definition file for trace messages.
By default, logs are sent to stdout and traces are not sent. This behavior may be
modified by users either by registering a user-defined subclass of
DiameterTraceLoggerListener
modified by users either by registering a user-defined subclass of
DiameterTraceLoggerListener
or by defining specific environment variables. An
example of a DiameterTraceLoggerListener implementation is as follows:
Class MyTraceLoggerListener implements DiameterTraceLoggerListener
{
// true or false.
public boolean isTracingEnabled()
{
return true;
}
public void log (String file, int line, int severity, String message)
{
String severity;
switch (severity) {
case LOG_INFO_SEVERITY: severity=
"
INFO
"
; break;
case LOG_WARNING_SEVERITY: severity=
"
WARNING
"
; break;
case LOG_ERROR_SEVERITY: severity=
"
ERROR
"
; break;
case LOG_DISASTER_SEVERITY: severity=
"
DISASTER
"
; break;
default: severity=
"
?
"
; break;
}