GemFire 5.8

com.gemstone.gemfire
Interface LogWriter


public interface LogWriter

Defines methods available to clients that want to write a log message to their GemFire distributed system log file.

Instances of this interface can be obtained by calling DistributedSystem.getLogWriter().

For any logged message the log file will contain:

A message always has a level. Logging levels are ordered. Enabling logging at a given level also enables logging at higher levels. The higher the level the more important and urgent the message.

The levels, in descending order, are:

For each level methods exist that will request a message, at that level, to be logged. These methods are all named after their level.

For each level a method exists that returns a boolean indicating if messages at that level will currently be logged. The names of these methods are of the form: levelEnabled.


Method Summary
 void config(String msg)
          Writes a message to this writer.
 void config(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void config(Throwable ex)
          Writes an exception to this writer.
 boolean configEnabled()
          Returns true if "config" log messages are enabled.
 void entering(String sourceClass, String sourceMethod)
          Log a method entry.
 void error(String msg)
          Writes a message to this writer.
 void error(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void error(Throwable ex)
          Writes an exception to this writer.
 boolean errorEnabled()
          Returns true if "error" log messages are enabled.
 void exiting(String sourceClass, String sourceMethod)
          Log a method return.
 void fine(String msg)
          Writes a message to this writer.
 void fine(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void fine(Throwable ex)
          Writes an exception to this writer.
 boolean fineEnabled()
          Returns true if "fine" log messages are enabled.
 void finer(String msg)
          Writes a message to this writer.
 void finer(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void finer(Throwable ex)
          Writes an exception to this writer.
 boolean finerEnabled()
          Returns true if "finer" log messages are enabled.
 void finest(String msg)
          Writes a message to this writer.
 void finest(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void finest(Throwable ex)
          Writes an exception to this writer.
 boolean finestEnabled()
          Returns true if "finest" log messages are enabled.
 Handler getHandler()
          Returns a 1.4 logging handler that can be used to direct application output to this GemFire logger using the standard JDK logger APIs.
 void info(String msg)
          Writes a message to this writer.
 void info(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void info(Throwable ex)
          Writes an exception to this writer.
 boolean infoEnabled()
          Returns true if "info" log messages are enabled.
 void severe(String msg)
          Writes a message to this writer.
 void severe(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void severe(Throwable ex)
          Writes an exception to this writer.
 boolean severeEnabled()
          Returns true if "severe" log messages are enabled.
 void throwing(String sourceClass, String sourceMethod, Throwable thrown)
          Log throwing an exception.
 void warning(String msg)
          Writes a message to this writer.
 void warning(String msg, Throwable ex)
          Writes both a message and exception to this writer.
 void warning(Throwable ex)
          Writes an exception to this writer.
 boolean warningEnabled()
          Returns true if "warning" log messages are enabled.
 

Method Detail

severeEnabled

boolean severeEnabled()
Returns true if "severe" log messages are enabled. Returns false if "severe" log messages are disabled.


severe

void severe(String msg,
            Throwable ex)
Writes both a message and exception to this writer. The message level is "severe".


severe

void severe(String msg)
Writes a message to this writer. The message level is "severe".


severe

void severe(Throwable ex)
Writes an exception to this writer. The exception level is "severe".


errorEnabled

boolean errorEnabled()
Returns true if "error" log messages are enabled. Returns false if "error" log messages are disabled.


error

void error(String msg,
           Throwable ex)
Writes both a message and exception to this writer. The message level is "error".


error

void error(String msg)
Writes a message to this writer. The message level is "error".


error

void error(Throwable ex)
Writes an exception to this writer. The exception level is "error".


warningEnabled

boolean warningEnabled()
Returns true if "warning" log messages are enabled. Returns false if "warning" log messages are disabled.


warning

void warning(String msg,
             Throwable ex)
Writes both a message and exception to this writer. The message level is "warning".


warning

void warning(String msg)
Writes a message to this writer. The message level is "warning".


warning

void warning(Throwable ex)
Writes an exception to this writer. The exception level is "warning".


infoEnabled

boolean infoEnabled()
Returns true if "info" log messages are enabled. Returns false if "info" log messages are disabled.


info

void info(String msg,
          Throwable ex)
Writes both a message and exception to this writer. The message level is "information".


info

void info(String msg)
Writes a message to this writer. The message level is "information".


info

void info(Throwable ex)
Writes an exception to this writer. The exception level is "information".


configEnabled

boolean configEnabled()
Returns true if "config" log messages are enabled. Returns false if "config" log messages are disabled.


config

void config(String msg,
            Throwable ex)
Writes both a message and exception to this writer. The message level is "config".


config

void config(String msg)
Writes a message to this writer. The message level is "config".


config

void config(Throwable ex)
Writes an exception to this writer. The exception level is "config".


fineEnabled

boolean fineEnabled()
Returns true if "fine" log messages are enabled. Returns false if "fine" log messages are disabled.


fine

void fine(String msg,
          Throwable ex)
Writes both a message and exception to this writer. The message level is "fine".


fine

void fine(String msg)
Writes a message to this writer. The message level is "fine".


fine

void fine(Throwable ex)
Writes an exception to this writer. The exception level is "fine".


finerEnabled

boolean finerEnabled()
Returns true if "finer" log messages are enabled. Returns false if "finer" log messages are disabled.


finer

void finer(String msg,
           Throwable ex)
Writes both a message and exception to this writer. The message level is "finer".


finer

void finer(String msg)
Writes a message to this writer. The message level is "finer".


finer

void finer(Throwable ex)
Writes an exception to this writer. The exception level is "finer".


entering

void entering(String sourceClass,
              String sourceMethod)
Log a method entry.

The logging is done using the finer level. The string message will start with "ENTRY" and include the class and method names.

Parameters:
sourceClass - Name of class that issued the logging request.
sourceMethod - Name of the method that issued the logging request.

exiting

void exiting(String sourceClass,
             String sourceMethod)
Log a method return.

The logging is done using the finer level. The string message will start with "RETURN" and include the class and method names.

Parameters:
sourceClass - Name of class that issued the logging request.
sourceMethod - Name of the method that issued the logging request.

throwing

void throwing(String sourceClass,
              String sourceMethod,
              Throwable thrown)
Log throwing an exception.

Use to log that a method is terminating by throwing an exception. The logging is done using the finer level.

This is a convenience method that could be done instead by calling finer(String, Throwable). The string message will start with "THROW" and include the class and method names.

Parameters:
sourceClass - Name of class that issued the logging request.
sourceMethod - Name of the method that issued the logging request.
thrown - The Throwable that is being thrown.

finestEnabled

boolean finestEnabled()
Returns true if "finest" log messages are enabled. Returns false if "finest" log messages are disabled.


finest

void finest(String msg,
            Throwable ex)
Writes both a message and exception to this writer. The message level is "finest".


finest

void finest(String msg)
Writes a message to this writer. The message level is "finest".


finest

void finest(Throwable ex)
Writes an exception to this writer. The exception level is "finest".


getHandler

Handler getHandler()
Returns a 1.4 logging handler that can be used to direct application output to this GemFire logger using the standard JDK logger APIs. Each time this method is called it creates a new instance of a Handler so care should be taken to not call this method too often.


GemFire 5.8

Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.