java.rmi.server
Class LogStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.PrintStream
              extended byjava.rmi.server.LogStream

Deprecated. no replacement

public class LogStream
extends PrintStream

LogStream provides a mechanism for logging errors that are of possible interest to those monitoring a system.

Since:
JDK1.1
Author:
Ann Wollrath (lots of code stolen from Ken Arnold)

Field Summary
static int BRIEF
          Deprecated. log level constant (brief logging).
private  StringBuffer buffer
          Deprecated. string buffer used for constructing log message prefixes
private  ByteArrayOutputStream bufOut
          Deprecated. stream used for buffering lines
private static PrintStream defaultStream
          Deprecated. default output stream for new logs
private static Hashtable known
          Deprecated. table mapping known log names to log stream objects
private  OutputStream logOut
          Deprecated. stream where output of this log is sent to
private  OutputStreamWriter logWriter
          Deprecated. string writer for writing message prefixes to log stream
private  String name
          Deprecated. log name for this log
static int SILENT
          Deprecated. log level constant (no logging).
static int VERBOSE
          Deprecated. log level constant (verbose logging).
 
Fields inherited from class java.io.PrintStream
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
private LogStream(String name, OutputStream out)
          Deprecated. no replacement
 
Method Summary
static PrintStream getDefaultStream()
          Deprecated. no replacement
 OutputStream getOutputStream()
          Deprecated. no replacement
static LogStream log(String name)
          Deprecated. no replacement
static int parseLevel(String s)
          Deprecated. no replacement
static void setDefaultStream(PrintStream newDefault)
          Deprecated. no replacement
 void setOutputStream(OutputStream out)
          Deprecated. no replacement
 String toString()
          Deprecated. no replacement
 void write(byte[] b, int off, int len)
          Deprecated. no replacement
 void write(int b)
          Deprecated. no replacement
 
Methods inherited from class java.io.PrintStream
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

known

private static Hashtable known
Deprecated. 
table mapping known log names to log stream objects


defaultStream

private static PrintStream defaultStream
Deprecated. 
default output stream for new logs


name

private String name
Deprecated. 
log name for this log


logOut

private OutputStream logOut
Deprecated. 
stream where output of this log is sent to


logWriter

private OutputStreamWriter logWriter
Deprecated. 
string writer for writing message prefixes to log stream


buffer

private StringBuffer buffer
Deprecated. 
string buffer used for constructing log message prefixes


bufOut

private ByteArrayOutputStream bufOut
Deprecated. 
stream used for buffering lines


SILENT

public static final int SILENT
Deprecated. 
log level constant (no logging).

See Also:
Constant Field Values

BRIEF

public static final int BRIEF
Deprecated. 
log level constant (brief logging).

See Also:
Constant Field Values

VERBOSE

public static final int VERBOSE
Deprecated. 
log level constant (verbose logging).

See Also:
Constant Field Values
Constructor Detail

LogStream

private LogStream(String name,
                  OutputStream out)
Deprecated. no replacement

Create a new LogStream object. Since this only constructor is private, users must have a LogStream created through the "log" method.

Parameters:
name - string identifying messages from this log
Since:
JDK1.1
Method Detail

log

public static LogStream log(String name)
Deprecated. no replacement

Return the LogStream identified by the given name. If a log corresponding to "name" does not exist, a log using the default stream is created.

Parameters:
name - name identifying the desired LogStream
Returns:
log associated with given name
Since:
JDK1.1

getDefaultStream

public static PrintStream getDefaultStream()
Deprecated. no replacement

Return the current default stream for new logs.

Returns:
default log stream
Since:
JDK1.1
See Also:
setDefaultStream(java.io.PrintStream)

setDefaultStream

public static void setDefaultStream(PrintStream newDefault)
Deprecated. no replacement

Set the default stream for new logs.

Parameters:
newDefault - new default log stream
Since:
JDK1.1
See Also:
getDefaultStream()

getOutputStream

public OutputStream getOutputStream()
Deprecated. no replacement

Return the current stream to which output from this log is sent.

Returns:
output stream for this log
Since:
JDK1.1
See Also:
setOutputStream(java.io.OutputStream)

setOutputStream

public void setOutputStream(OutputStream out)
Deprecated. no replacement

Set the stream to which output from this log is sent.

Parameters:
out - new output stream for this log
Since:
JDK1.1
See Also:
getOutputStream()

write

public void write(int b)
Deprecated. no replacement

Write a byte of data to the stream. If it is not a newline, then the byte is appended to the internal buffer. If it is a newline, then the currently buffered line is sent to the log's output stream, prefixed with the appropriate logging information.

Overrides:
write in class PrintStream
Parameters:
b - The byte to be written
Since:
JDK1.1
See Also:
PrintStream.print(char), PrintStream.println(char)

write

public void write(byte[] b,
                  int off,
                  int len)
Deprecated. no replacement

Write a subarray of bytes. Pass each through write byte method.

Overrides:
write in class PrintStream
Parameters:
b - A byte array
off - Offset from which to start taking bytes
len - Number of bytes to write
Since:
JDK1.1

toString

public String toString()
Deprecated. no replacement

Return log name as string representation.

Overrides:
toString in class Object
Returns:
log name
Since:
JDK1.1

parseLevel

public static int parseLevel(String s)
Deprecated. no replacement

Convert a string name of a logging level to its internal integer representation.

Parameters:
s - name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')
Returns:
corresponding integer log level
Since:
JDK1.1