gov.nist.javax.sip.stack
クラス ServerLog

java.lang.Object
  上位を拡張 gov.nist.javax.sip.stack.ServerLog

public class ServerLog
extends java.lang.Object

Log file wrapper class. Log messages into the message trace file and also write the log into the debug file if needed. This class keeps an XML formatted trace around for later access via RMI. The trace can be viewed with a trace viewer (see tools.traceviewerapp).

バージョン:
JAIN-SIP-1.1 $Revision: 1.15 $ $Date: 2004/09/01 02:04:16 $
作成者:
M. Ranganathan
This code is in the public domain.

フィールドの概要
static int TRACE_DEBUG
          Debug trace level (all tracing enabled).
static int TRACE_EXCEPTION
          Trace exception processing
static int TRACE_MESSAGES
           
static int TRACE_NONE
          Dont trace
 
コンストラクタの概要
ServerLog(SIPMessageStack sipStack)
           
 
メソッドの概要
 void checkLogFile()
           
 java.lang.String getLogFileName()
          return the name of the log file.
 int getTraceLevel()
          Get the trace level for the stack.
 void logException(java.lang.Exception ex)
          Log an exception stack trace.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, boolean sender)
          Log a message into the log directory.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, boolean sender, long time)
          Log a message into the log directory.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, boolean sender, java.lang.String time)
          Log a message into the log directory.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, java.lang.String status, boolean sender)
          Log a message into the log directory.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, java.lang.String status, boolean sender, long time)
          Log a message into the log directory.
 void logMessage(SIPMessage message, java.lang.String from, java.lang.String to, java.lang.String status, boolean sender, java.lang.String time)
          Log a message into the log directory.
 boolean needsLogging()
          Global check for whether to log or not.
 boolean needsLogging(int logLevel)
          Check to see if logging is enabled at a level (avoids unecessary message formatting.
 void println(java.lang.String s)
          print a line to stdout if the traceLevel is TRACE_DEBUG.
 void setAuxInfo(java.lang.String auxInfo)
          Set aux information.
 void setLogFileName(java.lang.String name)
          Set the log file name
 void setProperties(java.util.Properties configurationProperties)
           
 void setStackIpAddress(java.lang.String ipAddress)
           
 void setTraceLevel(int level)
          Set the trace level for the stack.
 void traceMsg(int msgLevel, java.lang.String tracemsg)
          Log a message into the log file.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

TRACE_NONE

public static int TRACE_NONE
Dont trace


TRACE_MESSAGES

public static int TRACE_MESSAGES

TRACE_EXCEPTION

public static int TRACE_EXCEPTION
Trace exception processing


TRACE_DEBUG

public static int TRACE_DEBUG
Debug trace level (all tracing enabled).

コンストラクタの詳細

ServerLog

public ServerLog(SIPMessageStack sipStack)
メソッドの詳細

setProperties

public void setProperties(java.util.Properties configurationProperties)

setStackIpAddress

public void setStackIpAddress(java.lang.String ipAddress)

checkLogFile

public void checkLogFile()

needsLogging

public boolean needsLogging(int logLevel)
Check to see if logging is enabled at a level (avoids unecessary message formatting.

パラメータ:
logLevel - level at which to check.

needsLogging

public boolean needsLogging()
Global check for whether to log or not. To minimize the time return false here.

戻り値:
true -- if logging is globally enabled and false otherwise.

setLogFileName

public void setLogFileName(java.lang.String name)
Set the log file name

パラメータ:
name - is the name of the log file to set.

getLogFileName

public java.lang.String getLogFileName()
return the name of the log file.


logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       boolean sender,
                       java.lang.String time)
Log a message into the log directory.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
sender - is the server the sender
time - is the time to associate with the message.

logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       boolean sender,
                       long time)
Log a message into the log directory.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
sender - is the server the sender
time - is the time to associate with the message.

logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       boolean sender)
Log a message into the log directory. Status information is extracted from SIPExtension header. The time associated with the message is the current time.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
sender - is the server the sender

logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       java.lang.String status,
                       boolean sender,
                       java.lang.String time)
Log a message into the log directory.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
status - the status to log.
sender - is the server the sender or receiver (true if sender).
time - is the reception time.

logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       java.lang.String status,
                       boolean sender,
                       long time)
Log a message into the log directory.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
status - the status to log.
sender - is the server the sender or receiver (true if sender).
time - is the reception time.

logMessage

public void logMessage(SIPMessage message,
                       java.lang.String from,
                       java.lang.String to,
                       java.lang.String status,
                       boolean sender)
Log a message into the log directory. Time stamp associated with the message is the current time.

パラメータ:
message - a SIPMessage to log
from - from header of the message to log into the log directory
to - to header of the message to log into the log directory
status - the status to log.
sender - is the server the sender or receiver (true if sender).

traceMsg

public void traceMsg(int msgLevel,
                     java.lang.String tracemsg)
Log a message into the log file.

パラメータ:
msgLevel - Logging level for this message.
tracemsg - message to write out.

logException

public void logException(java.lang.Exception ex)
Log an exception stack trace.

パラメータ:
ex - Exception to log into the log file

println

public void println(java.lang.String s)
print a line to stdout if the traceLevel is TRACE_DEBUG.

パラメータ:
s - String to print out.

setTraceLevel

public void setTraceLevel(int level)
Set the trace level for the stack.

パラメータ:
level - -- the trace level to set. The following trace levels are supported:
  • 0 -- no tracing
  • 16 -- trace messages only
  • 32 Full tracing including debug messages.

getTraceLevel

public int getTraceLevel()
Get the trace level for the stack.

戻り値:
the trace level

setAuxInfo

public void setAuxInfo(java.lang.String auxInfo)
Set aux information. Auxiliary information may be associated with the log file. This is useful for remote logs.

パラメータ:
auxInfo - -- auxiliary information.