Class SupportLogger

java.lang.Object
org.broadleafcommerce.common.logging.SupportLogger

public class SupportLogger extends Object

SupportLogger class that provides support for the new SUPPORT log level type. The SUPPORT log level is independent of any configured logging framework and should be able to be configured independently.

This Logger was originally built as an extension to Log4j's org.apache.log4j.Logger. As a result, other levels must be supported to maintain backwards compatibility.

It is important to note that the SupportLogger can be called outside a Spring Context. Therefore, it is possible to instantiate a different SupportLogger adapter using the fully qualified class name of an implementation using a System Property. By default, it will instantiate a SystemSupportLoggerAdapter if none is specified. For example, you may wish to disable all logs made to the Support Logger by setting the following System Property:

  • -DSupportLogger.adapter.fqcn=org.broadleafcommerce.common.logging.DisableSupportLoggerAdapter

The main requirements for SUPPORT level logging are to:

  • show up in the logs as a SUPPORT item (not ERROR or WARN etc...)
  • always show up unless configured otherwise, as we want users to always see SUPPORT messages
  • allow state messages to be associated with the log (e.g. "Enterprise Module — …")

Author:
Jeff Fischer, elbertbautista
  • Field Details

  • Constructor Details

    • SupportLogger

      public SupportLogger(String moduleName, String name)
  • Method Details

    • getSupportLoggerAdapterFQCN

      public static String getSupportLoggerAdapterFQCN()
    • support

      public void support(Object message)
      emit a SUPPORT level message
      Parameters:
      message -
    • support

      public void support(Object message, Throwable t)
      emit a SUPPORT level message with throwable
      Parameters:
      message -
      t -
    • lifecycle

      public void lifecycle(LifeCycleEvent lifeCycleEvent, Object message)
      emit a SUPPORT lifecycle message
      Parameters:
      lifeCycleEvent -
      message -
    • debug

      public void debug(Object message)
      In order to be backwards compatible. The support logger should also support the debug, error, fatal, info, and warn levels as well.
      Parameters:
      message -
    • debug

      public void debug(Object message, Throwable t)
    • error

      public void error(Object message)
    • error

      public void error(Object message, Throwable t)
    • fatal

      public void fatal(Object message)
    • fatal

      public void fatal(Object message, Throwable t)
    • info

      public void info(Object message)
    • info

      public void info(Object message, Throwable t)
    • warn

      public void warn(Object message)
    • warn

      public void warn(Object message, Throwable t)