Avaya Conferencinge Plugable Logging API

com.avaya.conferencing.logging
Class Logger

java.lang.Object
  extended by com.avaya.conferencing.logging.Logger
All Implemented Interfaces:
LogWorker

public abstract class Logger
extends java.lang.Object
implements LogWorker

An interface defining the Avaye Logging API. This interface will allow callers to log messages from Avaye APIs that will be logged successfully to the client applications logging framework. The specific implementation of the logging API is loaded via SPI at run-time.

Logging methods are provided to generate logs in the lowest impact manner (i.e. do not attempt generation of logs if the Logging framework's logging level will not allow the logs to be written out). Utility methods are provided to allow multiple arguments to the logging messages to avoid String concatenation by the caller (in this case, the log message is only formatted when the logging level is appropriate). Additionally, there is the format(LogMessage, Object...) method can be used to format a log message to ensure that exception messages are localized in the same way as log messages.

Since:
5.1.0.0.0

Field Summary
 LogWorker AUDIT
          The LogWorker for Audit log messages.
 LogWorker CORE
          The LogWorker for Development / Internal log messages.
 LogWorker OPERATIONAL
          The LogWorker for Operational log messages.
 LogWorker SECURITY
          The LogWorker for Security log messages.
 
Fields inherited from interface com.avaya.conferencing.logging.LogWorker
EXCEPTION_WITH_NO_MESSAGE
 
Constructor Summary
protected Logger(LogWorker COMMON)
          Creates a Logger without separation for different classes of log events.
protected Logger(LogWorker SECURITY, LogWorker OPERATIONAL, LogWorker AUDIT, LogWorker CORE)
          Creates a Logger with separation for different classes of log events.
 
Method Summary
 java.lang.String format(LogMessage message)
          Formats a log message and returns the formatted string.
 java.lang.String format(LogMessage message, java.lang.Object... args)
          Formats a log message and returns the formatted string.
 java.lang.String format(LogMessage message, java.lang.Object arg1)
          Formats a log message and returns the formatted string.
static Logger getLogger(java.lang.Class sourceClass)
          Creates and returns a Logger using LoggerManager's global factory.
 boolean isEnabledFor(Level level)
          Indicates whether the specified Level is enabled for the underlying framework
static java.util.ResourceBundle loadResourceBundle(java.lang.String resourceBundleName)
          A helper method to load the named resource bundle.
 void log(Level level, LogMessage message)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, LogMessage message, java.lang.Object... args)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, LogMessage message, java.lang.Object arg1)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, java.lang.Throwable throwable)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, java.lang.Throwable throwable, LogMessage message)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, java.lang.Throwable throwable, LogMessage message, java.lang.Object... args)
          A General purpose logging method, where the caller must specify a level
 void log(Level level, java.lang.Throwable throwable, LogMessage message, java.lang.Object arg1)
          A General purpose logging method, where the caller must specify a level
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY

public final LogWorker SECURITY
The LogWorker for Security log messages.

Since:
5.1.0.0.5

OPERATIONAL

public final LogWorker OPERATIONAL
The LogWorker for Operational log messages.

Since:
5.1.0.0.5

AUDIT

public final LogWorker AUDIT
The LogWorker for Audit log messages.

Since:
5.1.0.0.5

CORE

public final LogWorker CORE
The LogWorker for Development / Internal log messages.

Since:
5.1.0.0.5
Constructor Detail

Logger

protected Logger(LogWorker COMMON)
Creates a Logger without separation for different classes of log events.

Parameters:
COMMON - The log worker to use for all messages.

Logger

protected Logger(LogWorker SECURITY,
                 LogWorker OPERATIONAL,
                 LogWorker AUDIT,
                 LogWorker CORE)
Creates a Logger with separation for different classes of log events.

Parameters:
SECURITY - The log worker to use for security log messages.
OPERATIONAL - The log worker to use for operational log messages.
AUDIT - The log worker to use for audit log messages.
CORE - The log worker to use for development / internal log messages.
Method Detail

getLogger

public static Logger getLogger(java.lang.Class sourceClass)
Creates and returns a Logger using LoggerManager's global factory.

Parameters:
sourceClass - the class that the Logger object is for, the class which will be the source of the messages sent to the Logger.
Returns:
the Logger.

format

public java.lang.String format(LogMessage message)
Formats a log message and returns the formatted string.

Specified by:
format in interface LogWorker
Parameters:
message - the message to log
Returns:
The formatted message

format

public java.lang.String format(LogMessage message,
                               java.lang.Object arg1)
Formats a log message and returns the formatted string.

Specified by:
format in interface LogWorker
Parameters:
message - the message to log
arg1 - The argument to parse INTO the message
Returns:
The formatted message

format

public java.lang.String format(LogMessage message,
                               java.lang.Object... args)
Formats a log message and returns the formatted string.

Specified by:
format in interface LogWorker
Parameters:
message - the message to log
args - The list of arguments to parse INTO the message
Returns:
The formatted message

isEnabledFor

public boolean isEnabledFor(Level level)
Indicates whether the specified Level is enabled for the underlying framework

Specified by:
isEnabledFor in interface LogWorker
Parameters:
level - The Level that we need to check
Returns:
Whether the Level is enabled

log

public void log(Level level,
                java.lang.Throwable throwable)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
throwable - The exception

log

public void log(Level level,
                LogMessage message)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
message - The message to log

log

public void log(Level level,
                LogMessage message,
                java.lang.Object... args)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
message - The message to log
args - The list of arguments to parse INTO the message

log

public void log(Level level,
                LogMessage message,
                java.lang.Object arg1)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
message - The message to log
arg1 - The arguments to parse INTO the message

log

public void log(Level level,
                java.lang.Throwable throwable,
                LogMessage message)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
throwable - The exception
message - The message to log

log

public void log(Level level,
                java.lang.Throwable throwable,
                LogMessage message,
                java.lang.Object... args)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
throwable - The exception
message - The message to log
args - The list of arguments to parse INTO the message

log

public void log(Level level,
                java.lang.Throwable throwable,
                LogMessage message,
                java.lang.Object arg1)
A General purpose logging method, where the caller must specify a level

Specified by:
log in interface LogWorker
Parameters:
level - The level to generate the log at
throwable - The exception
message - The message to log
arg1 - The argument to parse INTO the message

loadResourceBundle

public static java.util.ResourceBundle loadResourceBundle(java.lang.String resourceBundleName)
A helper method to load the named resource bundle.

Parameters:
resourceBundleName - the resource bundle name.
Returns:
the resource bundle or null if no resource bundle could be found.

Avaya Conferencinge Plugable Logging API

Copyright © 2008-2009 Avaya, Inc. Licensed under the Apache License, Version 2.0.