Class sun.server.util.Log
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.util.Log

java.lang.Object
   |
   +----sun.server.util.Log

public class Log
extends Object
Base class for server logging server.

Variable Index

 o date
Date object for log entries.
 o level
The current logging level.
 o out
The output stream for writing log data.
 o useGMT
If true then output GMT instead of local time.

Constructor Index

 o Log()

Method Index

 o close()
Closes the output stream.
 o flush()
Flushes pending output.
 o getLevel()
Returns the current logging level.
 o setFile(String)
Redirects log output to the specified file.
 o setFile(String, boolean)
Redirects log output to the specified file.
 o setLevel(int)
Sets the logging level.
 o setOutputStream(OutputStream)
Sets logging output to the specified output stream.
 o useGMT(boolean)
If true specified then use GMT for date output, else use local time.

Variables

 o out
  protected TextOutputStream out
The output stream for writing log data.
 o level
  protected int level
The current logging level.
 o date
  protected Date date
Date object for log entries.
 o useGMT
  protected boolean useGMT
If true then output GMT instead of local time.

Constructors

 o Log
  public Log()

Methods

 o useGMT
  public synchronized void useGMT(boolean useGMT)
If true specified then use GMT for date output, else use local time.
 o setOutputStream
  public synchronized void setOutputStream(OutputStream out)
Sets logging output to the specified output stream.
Parameters:
out - the output stream
 o setFile
  public void setFile(String name) throws IOException
Redirects log output to the specified file. The file will be opened for appending.
Parameters:
name - the file name
Throws: IOException
if the file could not be opened for writing
 o setFile
  public void setFile(String name,
                      boolean append) throws IOException
Redirects log output to the specified file. If the append is true then the file will be opened for appending.
Parameters:
name - the file name
append - if true then append to existing file
Throws: IOException
if the file could not be opened for writing
 o setLevel
  public synchronized void setLevel(int level)
Sets the logging level. A level of 0 disables logging, and higher levels produce more detailed output.
Parameters:
level - the new logging level
 o getLevel
  public synchronized int getLevel()
Returns the current logging level.
 o flush
  public synchronized void flush()
Flushes pending output.
 o close
  public synchronized void close()
Closes the output stream.

All Packages  Class Hierarchy  This Package  Previous  Next  Index