blackboard.platform.log
Interface LogService

All Superinterfaces:
blackboard.platform.CorePlatformService, Log, blackboard.platform.SingletonService

public interface LogService
extends blackboard.platform.CorePlatformService, blackboard.platform.SingletonService, Log

Core platform service for managing different logs for messages from the application. Interaction with the actual log (writing messages, checking verbosity) is managed via the Log interface. This packages is meant to be generic enough to map to existing log facilities, such as java.util.logging or log4j.

Logs are maintained per application server when run in a load balanced environment. Verbosity goes from less to more messages: fatal, error, warning, information, debug.

Since:
Bb 5.5
See Also:
LogService.Verbosity

Nested Class Summary
static class LogService.Verbosity
          Enumeration of different log levels used in filtering log messages.
 
Method Summary
 void defineNewFileLog(java.lang.String logName, java.lang.String logFilePath, LogService.Verbosity verbosity, BbLocale locale, boolean copyToConsole)
          Convenience method to create a new file-based log.
 void defineNewFileLog(java.lang.String logName, java.lang.String logFilePath, LogService.Verbosity verbosity, BbLocale locale, boolean copyToConsole, boolean canLogFileBeRenamed)
          Convenience method to create a new file-based log.
 void defineNewFileLog(java.lang.String logName, java.lang.String logFilePath, LogService.Verbosity verbosity, boolean copyToConsole)
          Convenience method to create a new file-based log.
 Log getConfiguredLog(java.lang.String logName)
          Returns a log that has been configured by name or null if one is not found.
 Log getDefaultLog()
          Returns the Log instance configured as the default Log
 void setDefaultLog(Log defaultLog)
          Sets the default Log instance to use.
 void setDefaultThreadLog(Log defaultLog)
          Overrides the default Log instance to use in the current thread.
 
Methods inherited from interface blackboard.platform.CorePlatformService
getServiceInterface, serviceInit, serviceShutdown, serviceStartup
 
Methods inherited from interface blackboard.platform.log.Log
getLogFileName, getLogName, getVerbosityLevel, isDebugEnabled, log, log, logAudit, logAudit, logDebug, logDebug, logError, logError, logFatal, logFatal, logInfo, logInfo, logSqlWarnings, logSqlWarnings, logSqlWarnings, logSqlWarnings, logSqlWarnings, logWarning, logWarning, setVerbosityLevel
 

Method Detail

setDefaultLog

void setDefaultLog(Log defaultLog)
Sets the default Log instance to use.

Parameters:
defaultLog - Log instance to use

getDefaultLog

Log getDefaultLog()
Returns the Log instance configured as the default Log

Returns:
Default log

setDefaultThreadLog

void setDefaultThreadLog(Log defaultLog)
Overrides the default Log instance to use in the current thread. All other threads will continue to use the default log as set by setDefaultLog(blackboard.platform.log.Log).

The recommended pattern of use for this method is to set the override in a try block and revert to the default in an associated finally block.

Parameters:
defaultLog - Log to use for this thread. If null, the override will be removed and the global default will be used again.

getConfiguredLog

Log getConfiguredLog(java.lang.String logName)
Returns a log that has been configured by name or null if one is not found.

Parameters:
logName - Log to retrieve.
Returns:
Log specified by logName or null if none is found.

defineNewFileLog

void defineNewFileLog(java.lang.String logName,
                      java.lang.String logFilePath,
                      LogService.Verbosity verbosity,
                      boolean copyToConsole)
                      throws BbServiceException
Convenience method to create a new file-based log.

Note: This method is primarily for internal use and should be considered unstable and subject to change.

Parameters:
logName - Symbolic name for the new log.
logFilePath - File name to hold log entries. Relative to Blackboard directory.
verbosity - Verbosity level
copyToConsole - Flag indicating whether to send log output to stdout as well
Throws:
BbServiceException

defineNewFileLog

void defineNewFileLog(java.lang.String logName,
                      java.lang.String logFilePath,
                      LogService.Verbosity verbosity,
                      BbLocale locale,
                      boolean copyToConsole)
                      throws BbServiceException
Convenience method to create a new file-based log.

Note: This method is primarily for internal use and should be considered unstable and subject to change.

Parameters:
logName - Symbolic name for the new log.
logFilePath - File name to hold log entries. Relative to Blackboard directory.
verbosity - Verbosity level
locale - Desired locale of log
copyToConsole - Flag indicating whether to send log output to stdout as well
Throws:
BbServiceException

defineNewFileLog

void defineNewFileLog(java.lang.String logName,
                      java.lang.String logFilePath,
                      LogService.Verbosity verbosity,
                      BbLocale locale,
                      boolean copyToConsole,
                      boolean canLogFileBeRenamed)
                      throws BbServiceException
Convenience method to create a new file-based log.

Note: This method is primarily for internal use and should be considered unstable and subject to change.

Parameters:
logName - Symbolic name for the new log.
logFilePath - File name to hold log entries. Relative to Blackboard directory.
verbosity - Verbosity level
locale - Desired locale of log
copyToConsole - Flag indicating whether to send log output to stdout as well
canLogFileBeRenamed - Flag indicating whether to rename the log file
Throws:
BbServiceException


Copyright © 2012 Blackboard, Inc. All Rights Reserved.