logahawk
Class MultiLogger

java.lang.Object
  extended by logahawk.AbstractContainer<Logger>
      extended by logahawk.MultiLogger
All Implemented Interfaces:
Logger
Direct Known Subclasses:
FlattenedMultiLogger

@ThreadSafe
public class MultiLogger
extends AbstractContainer<Logger>
implements Logger

A Logger implementation that forwards all logging messages to other Logger instances. This class is intended to be used in situations where you have Loggers with different formatters. For example, one Logger might be intended to be viewed by non-technical users and so it removes any Exception arguments, while another Logger keeps the Exceptions and writes them to the log file for use by developers.


Field Summary
 
Fields inherited from class logahawk.AbstractContainer
items
 
Fields inherited from interface logahawk.Logger
LINE_SEPARATOR
 
Constructor Summary
MultiLogger()
           
MultiLogger(Collection<Logger> c)
           
 
Method Summary
 void alert(Object... data)
          Alert is an information message (like Logger.info(Object...)) but is more significant.
 void debug(Object... data)
          Debug is an developer or systems information message.
 void error(Object... data)
          Indicates a generic error occurred.
 void fatal(Object... data)
          Indicates a error occurred that halts some operation.
 List<Logger> getLoggers()
           
 void info(Object... data)
          Records nominal information about various operations.
 void log(Severity severity, Object... data)
          Logs message with a provide Severity.
 void panic(Object... data)
          Indicates a system error occurred that likely halts the entire application.
 void warn(Object... data)
          Indicates that something went wrong but the overarching process will continue.
 
Methods inherited from class logahawk.AbstractContainer
add, addAll, clear
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLogger

public MultiLogger()

MultiLogger

public MultiLogger(Collection<Logger> c)
Method Detail

alert

public void alert(Object... data)
Description copied from interface: Logger
Alert is an information message (like Logger.info(Object...)) but is more significant. For example the start or end of a long running process might be an alert so it stands out from the intervening info messages.

Specified by:
alert in interface Logger
See Also:
Severity.ALERT

debug

public void debug(Object... data)
Description copied from interface: Logger
Debug is an developer or systems information message. It is intended to be used by those who understand or have access to the internals of the application. Debug messages may be voluminous and so stable systems may choose to filter these out. (See SeverityFilterLogger.

Specified by:
debug in interface Logger
See Also:
Severity.DEBUG

error

public void error(Object... data)
Description copied from interface: Logger
Indicates a generic error occurred. This does not imply whether the process stopped or not, that distinction is often better served by the Logger.fatal(Object...) message.

Specified by:
error in interface Logger
See Also:
Severity.ERROR

fatal

public void fatal(Object... data)
Description copied from interface: Logger
Indicates a error occurred that halts some operation. This is more severe than an Logger.error(Object...) but less critical than Logger.panic(Object...) message. Some applications may have no use for this and may instead rely solely on Logger.error(Object...).

Specified by:
fatal in interface Logger
See Also:
Severity.FATAL

info

public void info(Object... data)
Description copied from interface: Logger
Records nominal information about various operations. This should be the most common method called.

Specified by:
info in interface Logger
See Also:
Severity.INFO

log

public void log(Severity severity,
                Object... data)
Description copied from interface: Logger
Logs message with a provide Severity. Useful for dynamically determined Severity messages.

Specified by:
log in interface Logger

panic

public void panic(Object... data)
Description copied from interface: Logger
Indicates a system error occurred that likely halts the entire application. This is the highest severity message, and it is likely that the application can no longer perform basic operations. Examples would be loss of all database connection, running out of temporary space (in an application that depends on it), unable to load expected classes, permission errors to core data, severe data corruption, etc. This message is akin to panic in interface Logger
See Also:
Severity.PANIC

warn

public void warn(Object... data)
Description copied from interface: Logger
Indicates that something went wrong but the overarching process will continue. This should be used when an error state is detected but can be recovered from.

Specified by:
warn in interface Logger
See Also:
Severity.WARN

getLoggers

public List<Logger> getLoggers()