psdi.util.logging

Class MXCorrelator

  • java.lang.Object
    • psdi.util.logging.MXCorrelator
    • Field Detail

      • correlationEnabled

        public static boolean correlationEnabled
        The flag to indicate if the correlation is enabled by the log appender. The flag is set by the initialization of maximo loggers. Only if this flag is true as well as the mxe.logging.CorrelationEnabled flag is true, the correlation will take effect.
      • CORRPROPERTY

        public static final java.lang.String CORRPROPERTY
        The property to indicate if correlation will be enabled. Only if the logger appender has correlation string enabled as well as this property is set to true, will the correlation be handled.
        See Also:
        Constant Field Values
      • sequence

        public static java.util.concurrent.atomic.AtomicLong sequence
        The static variable that contribute the number in the correlation id.
    • Method Detail

      • getCorrelator

        public static MXCorrelator getCorrelator()
      • startCorrelation

        public static MXCorrelator startCorrelation(java.lang.String prefix)
        Start a correlation. This should be paired up with the endCorrelation() call.
        Parameters:
        prefix -
        Returns:
      • endCorrelation

        public static void endCorrelation()
        End correlation. This method should be called in the finally block of startCorrelation() call.
      • stopCorrelation

        public void stopCorrelation()
        Stop a correlation.
      • getPrefix

        public java.lang.String getPrefix()
        Get the previx of the correlation id.
        Returns:
      • genUUID

        public static long genUUID()
        Get the squence number for the correlation id.
        Returns:
      • addCorrelationData

        public void addCorrelationData(java.lang.String label,
                                       java.lang.String dataItem)
        Add attribute to the correlation. The information will be logged when the correlation ended.
        Parameters:
        label -
        dataItem -
      • isCorrelatorEnabled

        public static boolean isCorrelatorEnabled()
        Check whether correlation is enabled.
        Returns:
      • enableCorrelation

        public static void enableCorrelation(boolean state)
        Enable the correlation from the logger pattern perspective.
        Parameters:
        state -
      • getCombinedId

        public java.lang.String getCombinedId()
        Get the correlation id.
        Returns:
      • getId

        public static java.lang.String getId()
        Get the correlation id.
        Returns: