com.ibm.as400.data
Class PcmlMessageLog
- java.lang.Object
-
- com.ibm.as400.data.PcmlMessageLog
-
public class PcmlMessageLog extends java.lang.Object
Provides control over logging and tracing activity within this package.PcmlMessageLog
can be used to redirect error logging to a specific log file orOutputStream
. It is also used to suppress the low level information/error messages normally written to the console.
-
-
Method Summary
Methods Modifier and Type Method and Description static java.lang.String
getLogFileName()
Deprecated.Replaced by com.ibm.as400.access.Trace.getFileName().static java.io.OutputStream
getLogStream()
Deprecated.Replaced by com.ibm.as400.access.Trace.getPrintWriter().static boolean
isTraceEnabled()
Deprecated.Replaced by com.ibm.as400.access.Trace.isTracePCMLOn().static void
logError(java.lang.Object errorData)
Deprecated.Replaced by com.ibm.as400.access.Trace.log(int category, String message).static void
logError(java.lang.Object errorData, java.lang.Throwable t)
Deprecated.Replaced by com.ibm.as400.access.Trace.log(int category, String message, Throwable e).static void
printStackTrace(java.lang.Throwable t)
Deprecated.Use java.lang.Throwable.printStackTrace(PrintWriter w).static void
setLogFileName(java.lang.String fileName)
Deprecated.Replaced by com.ibm.as400.access.Trace.setFileName(String fileName).static void
setLogStream(java.io.OutputStream stream)
Deprecated.Replaced by com.ibm.as400.access.Trace.setPrintWriter(PrintWriter obj).static void
setTraceEnabled(boolean enabled)
Deprecated.Replaced by com.ibm.as400.access.Trace.setTracePCMLOn(boolean tracePCML).static void
traceErr(java.lang.Object data)
Deprecated.This method does nothing. Replaced by com.ibm.as400.access.Trace.log(int category, String message).static void
traceOut(java.lang.Object data)
Deprecated.This method does nothing. Replaced by com.ibm.as400.access.Trace.log(int category, String message).
-
-
-
Method Detail
-
setLogFileName
public static void setLogFileName(java.lang.String fileName) throws java.io.IOException
Deprecated. Replaced by com.ibm.as400.access.Trace.setFileName(String fileName).Sets the log file name. If the file exists, error data is appended to it. If the file does not exist, it is created.- Parameters:
fileName
- the log file name. If null, output goes toSystem.err
.- Throws:
java.io.IOException
- if the file cannot be accessed- See Also:
getLogFileName()
-
getLogFileName
public static java.lang.String getLogFileName()
Deprecated. Replaced by com.ibm.as400.access.Trace.getFileName().Returns the log file name. Returns null if errors are being logged toSystem.err
, or if anOutputStream
was specified on a call tosetLogStream
.- Returns:
- the log file name
- See Also:
setLogFileName(java.lang.String)
,setLogStream(java.io.OutputStream)
-
setLogStream
public static void setLogStream(java.io.OutputStream stream)
Deprecated. Replaced by com.ibm.as400.access.Trace.setPrintWriter(PrintWriter obj).Sets the log stream. This method allows applications to redirect errors generated by this package to the sameOutputStream
used by the application itself for logging errors.- Parameters:
stream
- theOutputStream
to which error data should be sent. If null, output goes toSystem.err
.- See Also:
getLogStream()
-
getLogStream
public static java.io.OutputStream getLogStream()
Deprecated. Replaced by com.ibm.as400.access.Trace.getPrintWriter().Returns the log stream. This method is guaranteed to return a valid non-nullOutputStream
.- Returns:
- the
OutputStream
to which error data is being sent - See Also:
setLogStream(java.io.OutputStream)
-
logError
public static void logError(java.lang.Object errorData)
Deprecated. Replaced by com.ibm.as400.access.Trace.log(int category, String message).Logs an error string to the current logging destination. The string will be prepended with a header containing a date and timestamp if logging has been redirected to a destination other thanSystem.err
.- Parameters:
errorData
- the data to be logged
-
logError
public static void logError(java.lang.Object errorData, java.lang.Throwable t)
Deprecated. Replaced by com.ibm.as400.access.Trace.log(int category, String message, Throwable e).Logs an error string and a stack trace to the current logging destination. The string will be prepended with a header containing a date and timestamp if logging has been redirected to a destination other thanSystem.err
.- Parameters:
errorData
- the data to be loggedt
- theThrowable
which will be used to obtain the stack trace
-
printStackTrace
public static void printStackTrace(java.lang.Throwable t)
Deprecated. Use java.lang.Throwable.printStackTrace(PrintWriter w).Logs a stack trace to the current logging destination.- Parameters:
t
- theThrowable
which will be used to obtain the stack trace
-
setTraceEnabled
public static void setTraceEnabled(boolean enabled)
Deprecated. Replaced by com.ibm.as400.access.Trace.setTracePCMLOn(boolean tracePCML).Controls whether low level trace messages will be written to the console. The default value istrue
.- Parameters:
enabled
- If true, allows the messages; otherwise, suppresses the messages.- See Also:
isTraceEnabled()
-
isTraceEnabled
public static boolean isTraceEnabled()
Deprecated. Replaced by com.ibm.as400.access.Trace.isTracePCMLOn().Determines whether low level trace messages will be written to the console. The default value istrue
.- Returns:
- true if the messages are allowed; false otherwise.
- See Also:
setTraceEnabled(boolean)
-
traceOut
public static void traceOut(java.lang.Object data)
Deprecated. This method does nothing. Replaced by com.ibm.as400.access.Trace.log(int category, String message).Writes data toSystem.out
if low level tracing is enabled.- Parameters:
data
- the data to be logged- See Also:
traceErr(java.lang.Object)
-
traceErr
public static void traceErr(java.lang.Object data)
Deprecated. This method does nothing. Replaced by com.ibm.as400.access.Trace.log(int category, String message).Writes data toSystem.err
if low level tracing is enabled.- Parameters:
data
- the data to be logged- See Also:
traceOut(java.lang.Object)
-
-