Platform SDK Java 8.5 API Reference

com.genesyslab.platform.logging.runtime
Class AbstractLogger

java.lang.Object
  extended by com.genesyslab.platform.commons.log.AbstractLogEnabled
      extended by com.genesyslab.platform.logging.runtime.AbstractLogger
All Implemented Interfaces:
ILogEnabled, ILogger, LoggerEx
Direct Known Subclasses:
Logger, LoggerWraper

public abstract class AbstractLogger
extends AbstractLogEnabled
implements LoggerEx


Constructor Summary
AbstractLogger(java.lang.String name)
           
 
Method Summary
 boolean canLogMessage(LogLevel level)
          Determines if given level is enough for logging in current configuration.
 ILogger createChildLogger(java.lang.String name)
          Creates new child logger.
 LoggerEx createChildLoggerEx(java.lang.String name)
          Creates a new child logger.
 void debug(java.lang.Object message)
          Logs a debug message.
 void debug(java.lang.Object message, java.lang.Throwable exception)
          Logs a debug message.
 void debugFormat(java.lang.String format, java.lang.Object args)
          Logs a debug message.
 void error(java.lang.Object message)
          Logs an error message.
 void error(java.lang.Object message, java.lang.Throwable exception)
          Logs an error message.
 void errorFormat(java.lang.String format, java.lang.Object args)
          Logs an error message.
 void fatalError(java.lang.Object message)
          Logs a fatal error message.
 void fatalError(java.lang.Object message, java.lang.Throwable exception)
          Logs a fatal error message.
 void fatalErrorFormat(java.lang.String format, java.lang.Object args)
          Logs a fatal error message.
protected abstract  InternalRootLogger getInternalLogger()
           
 java.lang.String getName()
          Returns name of the logger
 RootLogger getRootLogger()
          Gets instance of root logger.
 void info(java.lang.Object message)
          Logs an info message.
 void info(java.lang.Object message, java.lang.Throwable exception)
          Logs an info message.
 void infoFormat(java.lang.String format, java.lang.Object args)
          Logs an info message.
 boolean isDebug()
          Determines if messages of priority "debug" will be logged.
 boolean isError()
          Determines if messages of priority "error" will be logged.
 boolean isFatalError()
          Determines if messages of priority "fatalError" will be logged.
 boolean isInfo()
          Determines if messages of priority "info" will be logged.
 boolean isWarn()
          Determines if messages of priority "warn" will be logged.
 void warn(java.lang.Object message)
          Logs a warn message.
 void warn(java.lang.Object message, java.lang.Throwable exception)
          Logs a warn message.
 void warnFormat(java.lang.String format, java.lang.Object args)
          Logs a warn message.
 void write(int messageId, java.lang.Object[] args)
          This method extracts the template for formatting message (by messageId) from lms file(s) and creates the message using the info from template.
 void write(LogEntry entry)
          Writes the passed LogEntry to outputs.
 
Methods inherited from class com.genesyslab.platform.commons.log.AbstractLogEnabled
enableLogging, getLogger, onEnableLogging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLogger

public AbstractLogger(java.lang.String name)
               throws LoggerException
Throws:
LoggerException
Method Detail

getName

public java.lang.String getName()
Description copied from interface: LoggerEx
Returns name of the logger

Specified by:
getName in interface LoggerEx

createChildLoggerEx

public LoggerEx createChildLoggerEx(java.lang.String name)
                             throws LoggerException
Description copied from interface: LoggerEx
Creates a new child logger. The name of the child logger is [current-loggers-name].[passed-in-name]

Specified by:
createChildLoggerEx in interface LoggerEx
Parameters:
name - The Subname of this logger
Throws:
LoggerException

createChildLogger

public ILogger createChildLogger(java.lang.String name)
Description copied from interface: ILogger
Creates new child logger. Name of a child logger usually looks like "[this-logger-name].[child-name]".

Specified by:
createChildLogger in interface ILogger
Parameters:
name - the child name for the new logger
Returns:
new ILogger instance

getRootLogger

public RootLogger getRootLogger()
Description copied from interface: LoggerEx
Gets instance of root logger.

Specified by:
getRootLogger in interface LoggerEx
Returns:
instance of root logger

getInternalLogger

protected abstract InternalRootLogger getInternalLogger()

debug

public void debug(java.lang.Object message)
Logs a debug message.

Specified by:
debug in interface ILogger
Parameters:
message - The Message.

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable exception)
Logs a debug message.

Specified by:
debug in interface ILogger
Parameters:
message - The Message.
exception - The exception.

debugFormat

public void debugFormat(java.lang.String format,
                        java.lang.Object args)
Logs a debug message.

Specified by:
debugFormat in interface ILogger
Parameters:
format - Message format.
args - Array of objects to write using format.
See Also:
MessageFormat

info

public void info(java.lang.Object message)
Logs an info message.

Specified by:
info in interface ILogger
Parameters:
message - The Message.

info

public void info(java.lang.Object message,
                 java.lang.Throwable exception)
Logs an info message.

Specified by:
info in interface ILogger
Parameters:
message - The Message.
exception - The Exception.

infoFormat

public void infoFormat(java.lang.String format,
                       java.lang.Object args)
Logs an info message.

Specified by:
infoFormat in interface ILogger
Parameters:
format - Message format.
args - Array of objects to write using format.
See Also:
MessageFormat

warn

public void warn(java.lang.Object message)
Logs a warn message.

Specified by:
warn in interface ILogger
Parameters:
message - The message.

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable exception)
Logs a warn message.

Specified by:
warn in interface ILogger
Parameters:
message - The Message.
exception - The Exception.

warnFormat

public void warnFormat(java.lang.String format,
                       java.lang.Object args)
Logs a warn message.

Specified by:
warnFormat in interface ILogger
Parameters:
format - Message format.
args - Array of objects to write using format.
See Also:
MessageFormat

error

public void error(java.lang.Object message)
Logs an error message.

Specified by:
error in interface ILogger
Parameters:
message - The message.

error

public void error(java.lang.Object message,
                  java.lang.Throwable exception)
Logs an error message.

Specified by:
error in interface ILogger
Parameters:
message - The Message.
exception - The Exception.

errorFormat

public void errorFormat(java.lang.String format,
                        java.lang.Object args)
Logs an error message.

Specified by:
errorFormat in interface ILogger
Parameters:
format - Message format.
args - Array of objects to write using format.
See Also:
MessageFormat

fatalError

public void fatalError(java.lang.Object message)
Logs a fatal error message.

Specified by:
fatalError in interface ILogger
Parameters:
message - The message.

fatalError

public void fatalError(java.lang.Object message,
                       java.lang.Throwable exception)
Logs a fatal error message.

Specified by:
fatalError in interface ILogger
Parameters:
message - The Message.
exception - The Exception.

fatalErrorFormat

public void fatalErrorFormat(java.lang.String format,
                             java.lang.Object args)
Logs a fatal error message.

Specified by:
fatalErrorFormat in interface ILogger
Parameters:
format - Message format.
args - Array of objects to write using format.
See Also:
MessageFormat

isDebug

public boolean isDebug()
Determines if messages of priority "debug" will be logged.

Specified by:
isDebug in interface ILogger
Returns:
true if "debug" messages will be logged.

isError

public boolean isError()
Determines if messages of priority "error" will be logged.

Specified by:
isError in interface ILogger
Returns:
true if "error" messages will be logged.

isFatalError

public boolean isFatalError()
Determines if messages of priority "fatalError" will be logged.

Specified by:
isFatalError in interface ILogger
Returns:
true if "fatalError" messages will be logged.

isInfo

public boolean isInfo()
Determines if messages of priority "info" will be logged.

Specified by:
isInfo in interface ILogger
Returns:
true if "info" messages will be logged.

isWarn

public boolean isWarn()
Determines if messages of priority "warn" will be logged.

Specified by:
isWarn in interface ILogger
Returns:
true if "warn" messages will be logged.

write

public void write(int messageId,
                  java.lang.Object[] args)
This method extracts the template for formatting message (by messageId) from lms file(s) and creates the message using the info from template. the created message is sent to all the outputs, formatted using the applyConfiguration() method.

Specified by:
write in interface LoggerEx
Parameters:
messageId - The of message to be written
args - Additional args

write

public void write(LogEntry entry)
Writes the passed LogEntry to outputs. Please note: this method does not formats meesages (i.e. no extracting of template from the lms file and formatting the string message is done) - all info about message is read from entry. If lms-based formatting is needed - please, use the overload write(int, Object[])"/>. The associated info (LogCategory, LogLevel and so on) is read from entry if message id is greater than 0 and from LoggerPolicy if message id is less or equal to 0. In any case - the time of message is converted to time, defined by logger settings. See TimeUsage for more info.

Specified by:
write in interface LoggerEx
Parameters:
entry - The LogEntry which contains info about message

canLogMessage

public boolean canLogMessage(LogLevel level)
Description copied from interface: LoggerEx
Determines if given level is enough for logging in current configuration.

Specified by:
canLogMessage in interface LoggerEx
Parameters:
level - log level to check
Returns:
true, if message is able to be printed with given level

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.