com.devsphere.logging
Class CompoundLogger

java.lang.Object
  |
  +--com.devsphere.logging.AbstractLogger
        |
        +--com.devsphere.logging.CompoundLogger

public class CompoundLogger
extends AbstractLogger

Logging mechanism that redirects any operation to two other loggers.

See Also:
AbstractLogger

Constructor Summary
CompoundLogger(AbstractLogger logger1, AbstractLogger logger2)
          Creates a compound logger.
 
Method Summary
 void close()
          Closes the two loggers.
 void flush()
          Flushes the two loggers.
 void log(java.lang.String message)
          Logs a message.
 void log(java.lang.String message, java.lang.Throwable throwable)
          Logs a message and an exception.
 void log(java.lang.Throwable throwable)
          Logs an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundLogger

public CompoundLogger(AbstractLogger logger1,
                      AbstractLogger logger2)
Creates a compound logger. Any logging operation will be redirected to the two given loggers.
Parameters:
logger1 - the first logger.
logger2 - the second logger.
Throws:
NullPointerException - if any of the logger parameters is null.
Method Detail

log

public void log(java.lang.String message)
Logs a message.
Overrides:
log in class AbstractLogger
Parameters:
message - the message that has to be logged.

log

public void log(java.lang.Throwable throwable)
Logs an exception.
Overrides:
log in class AbstractLogger
Parameters:
throwable - the exception that has to be logged.

log

public void log(java.lang.String message,
                java.lang.Throwable throwable)
Logs a message and an exception.
Overrides:
log in class AbstractLogger
Parameters:
message - the message that has to be logged.
throwable - the exception that has to be logged.

flush

public void flush()
Flushes the two loggers.
Overrides:
flush in class AbstractLogger

close

public void close()
Closes the two loggers.
Overrides:
close in class AbstractLogger