org.moyoman.log
Class SystemLog

java.lang.Object
  |
  +--org.moyoman.log.SystemLog

public class SystemLog
extends Object

This class logs events that occur in the server.


Field Summary
private static String debugFile
          The name of the file for writing out debug statements.
private static boolean debugFlag
           
private static String errorFile
          The name of the file for writing out error statements.
private static boolean errorFlag
           
private static String fatalFile
          The name of the file for writing out fatal statements.
private static String infoFile
          The name of the file for writing out informational statements.
private static boolean infoFlag
           
private static String level
          The level of message to actually write out.
private static String warningFile
          The name of the file for writing out warning statements.
private static boolean warningFlag
           
 
Constructor Summary
SystemLog()
           
 
Method Summary
static String convertExceptionToString(Exception e)
          Convert the information from the exception into a string.
static void debug(String msg)
          Log a debug event.
static void error(Exception e)
          Write out the exception as an error.
static void error(String msg)
          Log an error event.
static void fatal(Exception e)
          Write out the exception as a fatal error.
static void fatal(String msg)
          Log a fatal event and exit.
static void information(String msg)
          Log an informational event.
static void warning(Exception e)
          Write out the exception as a warning.
static void warning(String msg)
          Log a warning event.
private static void writeFile(String fname, String msg)
          Write out the information to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugFile

private static String debugFile
The name of the file for writing out debug statements.


infoFile

private static String infoFile
The name of the file for writing out informational statements.


warningFile

private static String warningFile
The name of the file for writing out warning statements.


errorFile

private static String errorFile
The name of the file for writing out error statements.


fatalFile

private static String fatalFile
The name of the file for writing out fatal statements.


level

private static String level
The level of message to actually write out.


debugFlag

private static boolean debugFlag

infoFlag

private static boolean infoFlag

warningFlag

private static boolean warningFlag

errorFlag

private static boolean errorFlag
Constructor Detail

SystemLog

public SystemLog()
Method Detail

debug

public static void debug(String msg)
Log a debug event.

Parameters:
msg - The message to log.

information

public static void information(String msg)
Log an informational event.

Parameters:
msg - The message to log.

warning

public static void warning(String msg)
Log a warning event.

Parameters:
msg - The message to log.

fatal

public static void fatal(String msg)
Log a fatal event and exit.

Parameters:
msg - The message to log.

error

public static void error(String msg)
Log an error event.

Parameters:
msg - The message to log.

warning

public static void warning(Exception e)
Write out the exception as a warning.

Parameters:
e - - The exception to be written out.

error

public static void error(Exception e)
Write out the exception as an error.

Parameters:
e - - The exception to be written out.

fatal

public static void fatal(Exception e)
Write out the exception as a fatal error.

Parameters:
e - - The exception to be written out.

convertExceptionToString

public static String convertExceptionToString(Exception e)
Convert the information from the exception into a string.

Parameters:
e - - The exception to be converted.
Returns:
A String which represents the exception.

writeFile

private static void writeFile(String fname,
                              String msg)
Write out the information to the file.

Parameters:
fname - - The file name
msg - - The message to be written out.