public class LogOutputStream
extends java.io.OutputStream
SimpleDateFormat
for format details.The typical format of the log file generated with this stream appears as follows:
2007-10-15 10:36:21 IST ---( Start )--- 2007-10-15 10:36:21 IST Logged message1 2007-10-15 10:36:21 IST Logged message2 2007-10-15 10:36:21 IST ---( End )---
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources associated with
the stream.
|
void |
flush()
Flushes this log output stream.
|
static byte[] |
intToBytes(int l)
Converts a given int value into a byte array.
|
static byte[] |
longToBytes(long l)
Converts a given long value into a byte array.
|
static byte[] |
shortToBytes(short l)
Converts a given short value into a byte array.
|
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to this output stream.
|
void |
write(int b)
Writes the specified byte to this output stream.
|
void |
write(java.lang.String msg)
Converts the given msg string into bytes by using the encoding specified by
the watt property "watt.server.logEncoding" and writes it to the target
output stream.
|
void |
writeBytes(byte[] msg)
Writes the date stamp in the format specified in this object followed by the
message bytes to the target output stream.
|
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- The byte to be written.java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
b
- The array of bytes to be written.java.io.IOException
public void write(java.lang.String msg)
msg
- The message String to be written.public void writeBytes(byte[] msg)
msg
- Array of message bytes to be written.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public static final byte[] longToBytes(long l)
1
- The long value to convert to a byte array.public static final byte[] intToBytes(int l)
l
- The int value to convert to a byte array.public static final byte[] shortToBytes(short l)
l
- The short value to convert to a byte array.