Novell exteNd
Director 5.2 API

com.sssw.fw.api
Interface EbiLog


public interface EbiLog

This is an interface for managing configured logs.

Following is an example of the configuration entries needed to configure a file log. Given a log named MyLogger: MyLogger.LoggingLevel 3 MyLogger.LogFieldSeparator | MyLogger.LoggingProvider com.sssw.fw.log.EboUniqueFileLoggingProvider MyLogger.LogFilePath c:\DirectorLogs\ MyLogger.LogFileExtension txt

To instantiate a configured log, call getLog( "logname" ), a static method of com.sssw.fw.log.EboFactory.

   com.sssw.fw.api.EbiLog myLog = EboFactory.getLog( "MyLogger" );

          myLog.trace( "some textual information" );
  

See Also:
EboLogFactory

Field Summary
static int CRITICAL_ERROR_LEVEL
          The system encountered a critical error at this logging level, which affects the accuracy, integrity, reliability, or capability of the system.
static int DEACTIVATE_LEVEL
          Turns the log off, no messages are logged
static int ERROR_LEVEL
          The system encountered an unexpected error at this logging level, which probably means the code intercepted an error it cannot handle.
static int INFO_LEVEL
          Informational logging level.
static int TRACE_LEVEL
          Most detailed logging level.
static int WARNING_LEVEL
          The system encountered an expected error situation.
 
Method Summary
 void audit(String logString)
          Writes the log string to the log at the audit log level.
 void criticalError(String logString)
          Writes the log string to the log at the criticalError log level.
 void criticalError(Throwable _e)
          Writes the exception to the log at the criticalError log level.
 void error(String logString)
          Writes the exception to the log at the error log level.
 void error(Throwable _e)
          Writes the exception to the log at the error log level.
 String getLogFieldSeparator()
          Returns the log separator string
 int getLoggingLevel()
          Returns the logging level of the log
 String getName()
          Returns the name of the log
 void info(String logString)
          Writes the exception to the log at the information log level.
 boolean isCritical()
          Returns true if the current log level is EbiLog.CRITICAL_LEVEL
 boolean isError()
          Returns true if the current log level is EbiLog.ERROR_LEVEL
 boolean isInfo()
          Returns true if the current log level is EbiLog.INFO_LEVEL
 boolean isLevel(int level)
          Returns true if the current log level is set to the level passed
 boolean isTrace()
          Returns true if the current log level is EbiLog.TRACE_LEVEL
 boolean isWarning()
          Returns true if the current log level is EbiLog.WARNING_LEVEL
 void logStackTrace(String info, Throwable th)
          Logs a Throwable's stack trace.
 void logStackTrace(Throwable th)
          Logs a Throwable's stack trace.
 void logString(String logString, int errorLevel)
          Writes the log string to the log.
 void setLoggingLevel(int newLoggingLevel)
          Sets the current logs logging level.
 void trace(String logString)
          Writes the exception to the log at the trace log level.
 void warning(String logString)
          Writes the exception to the log at the warning log level.
 

Field Detail

DEACTIVATE_LEVEL

public static final int DEACTIVATE_LEVEL
Turns the log off, no messages are logged

CRITICAL_ERROR_LEVEL

public static final int CRITICAL_ERROR_LEVEL
The system encountered a critical error at this logging level, which affects the accuracy, integrity, reliability, or capability of the system. Someone should be paged to address the error as soon as possible.

ERROR_LEVEL

public static final int ERROR_LEVEL
The system encountered an unexpected error at this logging level, which probably means the code intercepted an error it cannot handle. This error is not of a critical nature and can be recovered from automatically. Someone should probably be emailed to resolve the error in the near future to increase the reliability of the product.

WARNING_LEVEL

public static final int WARNING_LEVEL
The system encountered an expected error situation. The system recovered from it but the fact that it happened should be recorded to see how frequent it happens.

INFO_LEVEL

public static final int INFO_LEVEL
Informational logging level.

TRACE_LEVEL

public static final int TRACE_LEVEL
Most detailed logging level. Everything sent to the log will be logged. Use this level to trace system execution for really nasty problems.
Method Detail

isLevel

public boolean isLevel(int level)
Returns true if the current log level is set to the level passed
Parameters:
log - level to be used for comparison
Returns:
boolean indicator set to true if level matches that passed as a parameter.

isCritical

public boolean isCritical()
Returns true if the current log level is EbiLog.CRITICAL_LEVEL
Returns:
boolean indicator set to true if level is EbiLog.TRACE_LEVEL.
See Also:
EbiLog.CRITICAL_LEVEL

isError

public boolean isError()
Returns true if the current log level is EbiLog.ERROR_LEVEL
Returns:
boolean indicator set to true if level is EbiLog.ERROR_LEVEL.
See Also:
EbiLog.ERROR_LEVEL

isWarning

public boolean isWarning()
Returns true if the current log level is EbiLog.WARNING_LEVEL
Returns:
boolean indicator set to true if level is EbiLog.WARNING_LEVEL.
See Also:
EbiLog.WARNING_LEVEL

isInfo

public boolean isInfo()
Returns true if the current log level is EbiLog.INFO_LEVEL
Returns:
boolean indicator set to true if level is EbiLog.INFO_LEVEL.
See Also:
EbiLog.INFO_LEVEL

isTrace

public boolean isTrace()
Returns true if the current log level is EbiLog.TRACE_LEVEL
Returns:
boolean indicator set to true if level is EbiLog.TRACE_LEVEL.
See Also:
EbiLog.TRACE_LEVEL

logString

public void logString(String logString,
                      int errorLevel)
Writes the log string to the log.
Parameters:
A - String containing log information.
An - int indication of logging level.

audit

public void audit(String logString)
Writes the log string to the log at the audit log level.
Parameters:
A - String containing log information.

criticalError

public void criticalError(String logString)
Writes the log string to the log at the criticalError log level.
Parameters:
A - String containing log information.
See Also:
CRITICAL_ERROR_LEVEL

criticalError

public void criticalError(Throwable _e)
Writes the exception to the log at the criticalError log level.
Parameters:
A - Throwable containing log information.
See Also:
CRITICAL_ERROR_LEVEL

error

public void error(String logString)
Writes the exception to the log at the error log level.
Parameters:
A - String containing log information.
See Also:
ERROR_LEVEL

error

public void error(Throwable _e)
Writes the exception to the log at the error log level.
Parameters:
A - Throwable containing log information.
See Also:
ERROR_LEVEL

warning

public void warning(String logString)
Writes the exception to the log at the warning log level.
Parameters:
A - String containing log information.
See Also:
WARNING_LEVEL

setLoggingLevel

public void setLoggingLevel(int newLoggingLevel)
                     throws com.sssw.fw.api.EboDataException
Sets the current logs logging level.
Parameters:
An - int indicating desired logging level
Throws:
EboDataException -  

info

public void info(String logString)
Writes the exception to the log at the information log level.
Parameters:
A - String containing log information.
See Also:
INFO_LEVEL

trace

public void trace(String logString)
Writes the exception to the log at the trace log level.
Parameters:
A - String containing log information.
See Also:
TRACE_LEVEL

getName

public String getName()
Returns the name of the log
Returns:
A String containing log name.

getLoggingLevel

public int getLoggingLevel()
Returns the logging level of the log
Returns:
An int containing logging level.

getLogFieldSeparator

public String getLogFieldSeparator()
Returns the log separator string
Returns:
A String containing log separator.

logStackTrace

public void logStackTrace(String info,
                          Throwable th)
Logs a Throwable's stack trace.
Parameters:
info - A String with user info related to the exception
th - The Throwable in question

logStackTrace

public void logStackTrace(Throwable th)
Logs a Throwable's stack trace.
Parameters:
th - The Throwable in question

Novell exteNd
Director 5.2 API