Class CICSLogHelper

java.lang.Object
com.ibm.jakarta.connector2.cics.inbound.CICSLogHelper
All Implemented Interfaces:
CICSLogTraceLevels, Serializable

public class CICSLogHelper extends Object implements CICSLogTraceLevels, Serializable
Internal Helper class to provide standard logging for all CICS Resource Adapters. Only available to classes within the same package.
  • Field Details

  • Constructor Details

    • CICSLogHelper

      public CICSLogHelper()
      Create a Loghelper object. You will need to set the log using the set logwriter method before it will output. However it will output to the client trace if client trace is turned on. It is not possible for the client to write to the log here, the file will be in use and the client cannot handle printWriter objects, only printstream objects. There is no way to map a printWriter object to a printStream object.
  • Method Details

    • setLogWriter

      public void setLogWriter(PrintWriter newLog)
      Set the Log to be used by this Object
      Parameters:
      newLog - a new PrintWriter Object
    • getTraceLevel

      public int getTraceLevel()
      Get the Trace Level for this Object
      Returns:
      The current Trace Level
    • getRealTraceLevel

      public int getRealTraceLevel()
      This returns the trace level ONLY if tracing is active on runtime or tracing is on within the Gateway. Otherwise it returns RAS_TRACE_OFF

      This is handy to determine whether traceEntry, traceExit, traceDebug or traceEx will actually do anything, traceLine will work if client trace rather than debug is on, in this case, this method won't work.

      Returns:
      The current Trace Level
    • setTraceLevel

      public void setTraceLevel(int newLevel)
      Set the Trace Level to be used by this Object.
      Parameters:
      newLevel - The new Trace Level
    • traceEntry

      public void traceEntry(Object caller, String method, Object parms)
    • traceEntry

      public void traceEntry(Object caller, String method, String parms)
      This method should be called to trace entry to a method
      Parameters:
      caller - this caller reference (usually use 'this')
      method - the method name
      parms - Information on parameters passed
    • traceExit

      public void traceExit(Object caller, String method, String returns)
      This method should be called to trace exit of a method
      Parameters:
      caller - this caller reference (usually use 'this')
      method - the method name
      returns - information on what is returned
    • traceMessage

      public void traceMessage(String msg)
      This method should be called to provide a message, for example Resource Adapter Initialised... These should probably be translated. Not sent to client trace.
      Parameters:
      msg - The message to Trace
    • traceDebug

      public void traceDebug(Object caller, String msg)
      This method should be called to provide a low level debug trace
      Parameters:
      caller - this caller reference (usually use 'this')
      msg - The message to Trace
    • traceEx

      public void traceEx(Object caller, Throwable ex)
      This method should be called to trace an exception
      Parameters:
      caller - this caller reference (usually use 'this')
      ex - The Exception to Trace
    • traceHex

      public void traceHex(Object caller, byte[] byteDump, String msg)
      This method do a hex dump of a byte array to the log
      Parameters:
      caller - this caller reference (usually use 'this')
      byteDump - the byte array to dump
      msg - a header for the dump