OOP MimeParser Version 3.5

com.bentofw.util
Interface GenericLogger

All Known Implementing Classes:
Logger4Jcl, Logger4Jdk

public interface GenericLogger

Interface for logging. The implementation of this interface will be used within Java API by OOP-Research.

Apache Common Logging API implements the sophisticated interface for logging, and allows the Java developers to choose their favorite underlying logging API, such as Java Logging in JDK 1.4 or Log4J. But, there may be a case that the Java developers cannot depend on Apache Common Logging API. In that case, Java Logging in JDK 1.4 will be the only choice. To be ready for it, Java APIs by OOP-Research write the log records through this interface.
There are 2 implementations of this interface:


NOTE:
The Java developers should not need to use this interface to log the records from their application, i.e. they should use their preferred logging API (Java Logging in JDK or Apache Common Logging) as usual. This interface should be used to log the records from the Java API by OOP-Research.
 import org.apache.commons.logging.Log;

 // If you use Apache Common Logging
 private Log log=...

 // Java API by OOP-Research
 private MailScheduler mail=...

 // Write the record from your application.
 log.warn("Something is strange ...");

 // Wrap Apache Common Logging by this interface.
 GenericLogger gen=new Logger4Jcl(log);

 // Pass this interface to MailScheduler.
 mail.setLogger(gen);

 
By the above code fragment, MailScheduler (one of Java APIs by OOP-Research) writes the its own records into Apache Common Logging, along with the records from the application.

Author:
Jun Inamori

Method Summary
 void log(java.util.logging.Level level, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg)
          Log a message, specifying source class and method.
 void log(java.util.logging.Level level, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg, java.lang.Throwable thrown)
          Log a message, specifying source class and method, with associated Throwable information.
 

Method Detail

log

void log(java.util.logging.Level level,
         java.lang.String sourceClass,
         java.lang.String sourceMethod,
         java.lang.String msg)
Log a message, specifying source class and method.

Parameters:
level - One of the message level identifiers, e.g. SEVERE
sourceClass - name of class that issued the logging request
sourceMethod - name of method that issued the logging request
msg - The string message

log

void log(java.util.logging.Level level,
         java.lang.String sourceClass,
         java.lang.String sourceMethod,
         java.lang.String msg,
         java.lang.Throwable thrown)
Log a message, specifying source class and method, with associated Throwable information.

Parameters:
level - One of the message level identifiers, e.g. SEVERE
sourceClass - name of class that issued the logging request
sourceMethod - name of method that issued the logging request
msg - The string message
thrown - Throwable associated with log message

OOP MimeParser Version 3.5

ALL CONTENTS COPYRIGHT 2005, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.