com.ibm.commerce.ras
Class LogFile

java.lang.Object
  |
  +--com.ibm.commerce.ras.LogFile
All Implemented Interfaces:
IOutputManager

public final class LogFile
extends java.lang.Object
implements IOutputManager

LogFile is used to define the file output of the Logging service.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
protected  java.io.PrintWriter pWriter
          The PrintWriter that sends a formatted log event to its destination.
 
Constructor Summary
LogFile()
          Constructor for LogFile.
LogFile(java.lang.String fileName)
          Constructor for LogFile with specified file name.
 
Method Summary
 void closeDevice()
          Closes the log file.
protected  void finalize()
          Closes the log device for cleanup.
 long getTriggerSize()
          Gets the trigger size of the file.
static void main(java.lang.String[] args)
          A test example.
protected  void openDevice()
          Opens a new log file.
 void print(java.lang.String message)
          Writes to the log file.
 void setLogFileName(java.lang.String newLogFileName)
          Sets the log file name.
 void setTriggerSize(long newTriggerSize)
          Sets the maximum size of the file, in KB.
 void writeln(java.lang.String message)
          Writes the message to the log file.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values

pWriter

protected transient java.io.PrintWriter pWriter
The PrintWriter that sends a formatted log event to its destination.
Constructor Detail

LogFile

public LogFile()
Constructor for LogFile.

LogFile

public LogFile(java.lang.String fileName)
Constructor for LogFile with specified file name.
Parameters:
fileName - file name to write logs to
Method Detail

closeDevice

public void closeDevice()
Closes the log file.

finalize

protected void finalize()
Closes the log device for cleanup.
Overrides:
finalize in class java.lang.Object

getTriggerSize

public long getTriggerSize()
Gets the trigger size of the file.
Returns:
the maximum file size

main

public static void main(java.lang.String[] args)
A test example.

openDevice

protected void openDevice()
Opens a new log file.

print

public void print(java.lang.String message)
Writes to the log file.
Specified by:
print in interface IOutputManager
Parameters:
message - string

setLogFileName

public void setLogFileName(java.lang.String newLogFileName)
Sets the log file name.
Parameters:
newLogFileName - log file name

setTriggerSize

public void setTriggerSize(long newTriggerSize)
Sets the maximum size of the file, in KB. When this size is reached, another file is open.
Parameters:
newTriggerSize - long: the maximum file size in KBytes.

writeln

public void writeln(java.lang.String message)
Writes the message to the log file.
Parameters:
message - string