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.
-
date
- Date object for log entries.
-
level
- The current logging level.
-
out
- The output stream for writing log data.
-
useGMT
- If true then output GMT instead of local time.
-
Log()
-
-
close()
- Closes the output stream.
-
flush()
-
Flushes pending output.
-
getLevel()
- Returns the current logging level.
-
setFile(String)
- Redirects log output to the specified file.
-
setFile(String, boolean)
- Redirects log output to the specified file.
-
setLevel(int)
- Sets the logging level.
-
setOutputStream(OutputStream)
- Sets logging output to the specified output stream.
-
useGMT(boolean)
- If true specified then use GMT for date output, else use local time.
out
protected TextOutputStream out
- The output stream for writing log data.
level
protected int level
- The current logging level.
date
protected Date date
- Date object for log entries.
useGMT
protected boolean useGMT
- If true then output GMT instead of local time.
Log
public Log()
useGMT
public synchronized void useGMT(boolean useGMT)
- If true specified then use GMT for date output, else use local time.
setOutputStream
public synchronized void setOutputStream(OutputStream out)
- Sets logging output to the specified output stream.
- Parameters:
- out - the output stream
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
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
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
getLevel
public synchronized int getLevel()
- Returns the current logging level.
flush
public synchronized void flush()
- Flushes pending output.
close
public synchronized void close()
- Closes the output stream.
All Packages Class Hierarchy This Package Previous Next Index