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 or OutputStream. 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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 to System.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 to System.err, or if an OutputStream was specified on a call to setLogStream.
        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 same OutputStream used by the application itself for logging errors.
        Parameters:
        stream - the OutputStream to which error data should be sent. If null, output goes to System.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-null OutputStream.
        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 than System.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 than System.err.
        Parameters:
        errorData - the data to be logged
        t - the Throwable 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 - the Throwable 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 is true.
        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 is true.
        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 to System.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 to System.err if low level tracing is enabled.
        Parameters:
        data - the data to be logged
        See Also:
        traceOut(java.lang.Object)