|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--java.io.PrintStream | +--com.adventnet.afp.log.LogPrintStream
This class will direct all the system out and system err log messages to the files mentioned under the SYS_OUT and SYS_ERR tags respectively. These tags are similar to LOG_WRITER tag in the file conf/logging.xml. The system out and system err properties will be retreived from the class XMLLogReader. The message "Logging Started" will be displayed for every start of the new file. The message "Logging Continued" will be displayed when the file is changed. The current log file will be always the stdout.txt and stderr.txt . Only the previous files will be incremented. The line count and the file count is maintained in each and every log files stdout and stderr. After initializing this class, the further System.out and System.err calls will move the corresponding messages to the files stdout and stderr respectively under logs directory.
Field Summary |
Fields inherited from class java.io.FilterOutputStream |
out |
Method Summary | |
static void |
closePrintStream()
This method will close both the SYS_OUT and SYS_ERR streams that are opened. |
static void |
init(java.lang.String homeDir,
java.lang.String configurationFileName)
This method obtains all the properties for the SYS_OUT and SYS_ERR from the file XMLLogReader. |
void |
print(boolean message)
|
void |
print(char message)
|
void |
print(char[] message)
|
void |
print(double message)
|
void |
print(float message)
|
void |
print(int message)
|
void |
print(long message)
|
void |
print(java.lang.Object message)
|
void |
print(java.lang.String message)
|
void |
println()
|
void |
println(boolean message)
|
void |
println(char message)
|
void |
println(char[] message)
|
void |
println(double message)
|
void |
println(float message)
|
void |
println(int message)
|
void |
println(long message)
|
void |
println(java.lang.Object message)
|
void |
println(java.lang.String message)
|
static void |
setErr(java.lang.String header)
This method will open the new print stream for the System err messages. |
static void |
setOut(java.lang.String header)
This method will open the new print stream for the System out messages. |
static void |
setSysErrProps(java.util.Properties errProp)
This method will set all the system err properties to their respective variables. |
static void |
setSysOutProps(java.util.Properties outProp)
This method will set all the system out properties to their respective variables. |
Methods inherited from class java.io.PrintStream |
checkError, close, flush, setError, write, write |
Methods inherited from class java.io.FilterOutputStream |
write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void init(java.lang.String homeDir, java.lang.String configurationFileName) throws LogException
homeDir
- It will get the home directory.configurationFileName
- It will get the configuration file names(For example, logging.xml).
LogException
- if an error occurs during initializationpublic static void setSysOutProps(java.util.Properties outProp) throws LogException
outProp
- SYS_OUT properties are passed.
LogException
- if an error occurs during setting of the SYS_OUT properties.public static void setSysErrProps(java.util.Properties errProp) throws LogException
errProp
- SYS_ERR properties are passed.
LogException
- if an error occurs during setting of the SYS_ERR properties.public void println(java.lang.String message)
println
in class java.io.PrintStream
public void println(java.lang.Object message)
println
in class java.io.PrintStream
public void println(long message)
println
in class java.io.PrintStream
public void println(int message)
println
in class java.io.PrintStream
public void println(float message)
println
in class java.io.PrintStream
public void println(double message)
println
in class java.io.PrintStream
public void println(char[] message)
println
in class java.io.PrintStream
public void println(char message)
println
in class java.io.PrintStream
public void println(boolean message)
println
in class java.io.PrintStream
public void println()
println
in class java.io.PrintStream
public void print(java.lang.String message)
print
in class java.io.PrintStream
public void print(java.lang.Object message)
print
in class java.io.PrintStream
public void print(long message)
print
in class java.io.PrintStream
public void print(int message)
print
in class java.io.PrintStream
public void print(float message)
print
in class java.io.PrintStream
public void print(double message)
print
in class java.io.PrintStream
public void print(char[] message)
print
in class java.io.PrintStream
public void print(char message)
print
in class java.io.PrintStream
public void print(boolean message)
print
in class java.io.PrintStream
public static void closePrintStream() throws LogException
LogException
- if an error occurs while closing the streams.public static void setOut(java.lang.String header) throws LogException
header
- The header is printed at the top of the new file .
LogException
- If an error occurs during initialization of stdout streampublic static void setErr(java.lang.String header) throws LogException
header
- The header is printed at the top of the new file.
LogException
- If an error occurs during initialization of stderr stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |