org.mortbay.log

Class LogStream

Known Direct Subclasses:
LogStream.STDERR, LogStream.STDOUT

public class LogStream
extends PrintStream

Divert a PrintStream to commons logging. The stderr and stdout streams can be diverted to logs named "stderr" and "stdout" using this class.

Nested Class Summary

static class
LogStream.STDERR
static class
LogStream.STDOUT

Constructor Summary

LogStream(String tag, Log log)

Method Summary

void
close()
void
flush()
static boolean
getLogStdErr()
static boolean
getLogStdOut()
void
println()
void
println(Object arg0)
void
println(String arg0)
void
println(boolean arg0)
void
println(char arg0)
void
println(char[] arg0)
void
println(double arg0)
void
println(float arg0)
void
println(int arg0)
void
println(long arg0)
static void
setLogStdErr(boolean log)
Log standard error stream.
static void
setLogStdOut(boolean log)
Log standard output stream.
void
write(byte[] arg0, int arg1, int arg2)

Constructor Details

LogStream

public LogStream(String tag,
                 Log log)
Parameters:

Method Details

close

public void close()

flush

public void flush()

getLogStdErr

public static boolean getLogStdErr()

getLogStdOut

public static boolean getLogStdOut()

println

public void println()

println

public void println(Object arg0)

println

public void println(String arg0)

println

public void println(boolean arg0)

println

public void println(char arg0)

println

public void println(char[] arg0)

println

public void println(double arg0)

println

public void println(float arg0)

println

public void println(int arg0)

println

public void println(long arg0)

setLogStdErr

public static void setLogStdErr(boolean log)
Log standard error stream. If set to true, output to stderr will be directed to an instance of LogStream and logged. Beware of log loops from logs that write to stderr.

setLogStdOut

public static void setLogStdOut(boolean log)
Log standard output stream. If set to true, output to stdout will be directed to an instance of LogStream and logged. Beware of log loops from logs that write to stdout.

write

public void write(byte[] arg0,
                  int arg1,
                  int arg2)

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.