Class SessionTracer

java.lang.Object
com.priint.pubserver.tracing.SessionTracer

@Deprecated(since="4.6.0", forRemoval=true) public class SessionTracer extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Tracer for writing session specific trace messages into a persistent data store.

Create a tracer only once in a class.

 Tracer tracer = new Tracer("MyDataFunctions"); 
Use simple or extended signature of methods. You are strongly advised to use message as a template with "{}" for replacement. Add replacements in open argument list, so that they only get evaluated, when trace is really written and not e.g. for sessions that do not log.
 tracer.info("my message {} {} {}", "eins", new Integer(2), Float.parse("3.0"));
 tracer.warnExtended("mysource", "my message for something: {}", "my hint", someObject);
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a tracer object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    errorAndLog(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    errorExtended(String source, String message, String hint, boolean log, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    info(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    infoAndLog(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    infoExtended(String source, String message, String hint, boolean log, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    logAndTrace(TracerMessage.MessageType messageType, String source, String message, String hint, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    warn(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    warnAndLog(String message, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    warnExtended(String source, String message, String hint, boolean log, Object... argArray)
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SESSION_TRACE_ACTIVE_PROPERTY

      public static final String SESSION_TRACE_ACTIVE_PROPERTY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Constructor Details

    • SessionTracer

      public SessionTracer(String source)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a tracer object.
      Parameters:
      source - Source of tracer (like plugin name and / or method name)
  • Method Details

    • info

      @Deprecated(since="4.6.0", forRemoval=true) public void info(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write info to session trace.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • infoAndLog

      @Deprecated(since="4.6.0", forRemoval=true) public void infoAndLog(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write info to session trace and to server log.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • error

      @Deprecated(since="4.6.0", forRemoval=true) public void error(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write error to session trace.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • errorAndLog

      @Deprecated(since="4.6.0", forRemoval=true) public void errorAndLog(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write error to session trace and server log.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • warn

      @Deprecated(since="4.6.0", forRemoval=true) public void warn(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write warning to session trace.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • warnAndLog

      @Deprecated(since="4.6.0", forRemoval=true) public void warnAndLog(String message, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write warning to session trace and server log.
      Parameters:
      message - text for trace and log
      argArray - arguments to be used for replacement in message string
      See Also:
    • infoExtended

      @Deprecated(since="4.6.0", forRemoval=true) public void infoExtended(String source, String message, String hint, boolean log, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write an INFO trace message for a session. Analogous to a call to logger.info().

      For information on the arguments see TracerMessage.

      Parameters:
      source - optional module or class and method name
      message - text for trace and log
      hint - optional information to user what to she can do
      log - if true then SessionTracer will also write this message into the server log - at debug level
      argArray - arguments to be used for replacement in message string
    • errorExtended

      @Deprecated(since="4.6.0", forRemoval=true) public void errorExtended(String source, String message, String hint, boolean log, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write an ERROR trace message for a session. Analogous to a call to logger.error().

      For information on the arguments see TracerMessage.

      Parameters:
      source - optional module or class and method name
      message - text for trace and log
      hint - optional information to user what to she can do
      log - if true then SessionTracer will also write this message into the server log - at debug level
      argArray - arguments to be used for replacement in message string
    • warnExtended

      @Deprecated(since="4.6.0", forRemoval=true) public void warnExtended(String source, String message, String hint, boolean log, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Write an WARNING trace message for a session. Analogous to a call to logger.warn().

      For information on the arguments see TracerMessage.

      Parameters:
      source - optional module or class and method name
      message - text for trace and log
      hint - optional information to user what to she can do
      log - if true then SessionTracer will also write this message into the server log - at debug level
      argArray - arguments to be used for replacement in message string
    • isActive

      @Deprecated(since="4.6.0", forRemoval=true) public boolean isActive()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if trace mode is active for the current session.
    • logAndTrace

      @Deprecated(since="4.6.0", forRemoval=true) public void logAndTrace(TracerMessage.MessageType messageType, String source, String message, String hint, Object... argArray)
      Deprecated, for removal: This API element is subject to removal in a future version.
      writes a message to the server log and additionally - if tracing is enabled - writes a trace too.

      log level is tracing level - 1, e.g. trace error = log warn, trace warning = log info, trace info = log debug

      Parameters:
      messageType -
      source -
      message -
      hint -
      argArray -