Class Log

java.lang.Object
org.bgerp.util.Log
Direct Known Subclasses:
Log

public class Log extends Object
Logging wrapper around Log4j version 1 with additional functions from version 2.
  • Field Details

  • Constructor Details

    • Log

      protected Log(org.apache.log4j.Logger logger)
      Make private later, temporary protected for backward compatible inherited class.
  • Method Details

    • getLog

      public static Log getLog(Class<?> clazz)
      Class connected logger.
      Parameters:
      clazz - the class.
      Returns:
      logger configured for clazz
    • getLog

      public static Log getLog()
      Using StackLocatorUtil gets the caller's object and logger for its class.
      Returns:
      logger configured for the caller object's class.
    • format

      public static String format(String message, Object... args)
      Formats message using pattern with substitutions.
      Parameters:
      message - format using FormattedMessage, supports both &#123;&#125; and %s substitutions.
      args - parameters for replacements in message.
      Returns:
    • trace

      public void trace(String message, Object... params)
      Executes log(Priority, String, Object...) with Level.TRACE
    • debug

      public void debug(String message, Object... args)
      Executes log(Priority, String, Object...) with Level.DEBUG
    • isDebugEnabled

      public boolean isDebugEnabled()
      Returns:
      is Level.DEBUG enabled.
    • info

      public void info(String message, Object... args)
      Executes log(Priority, String, Object...) with Level.INFO.
    • warn

      public void warn(String message, Object... args)
      Executes log(Priority, String, Object...) with Level.WARN.
    • warnd

      public void warnd(String message, Object... args)
      Special warn call for deprecation messages.
      Parameters:
      message - the message text pattern.
      args -
    • warndMethod

      public void warndMethod(String deprecatedName, String actualName)
      Writes deprecation warning for a called method.
      Parameters:
      deprecatedName - the deprecated method name.
      actualName - the actual method name or null if no such exists.
    • warndClass

      public void warndClass(Class<?> deprecatedClass, Class<?> actualClass)
      Writes deprecated warning for a created class instance
      Parameters:
      deprecatedClass - the deprecated class
      actualClass - the actual ones
    • warndJsp

      public void warndJsp(String deprecatedCall, String actionCall)
      Writes deprecation warning for a JSP call.
      Parameters:
      deprecatedName - the deprecated call string.
      actualName - the actual call string.
    • error

      public void error(String message, Object... args)
      Executes log(Priority, String, Object...) with Level.ERROR.
    • error

      public void error(Throwable e)
      Logs error message from e and stack trace.
      Parameters:
      e - the exception.
    • error

      public void error(String message, Throwable e)
      Logs error message and stack trace.
      Parameters:
      message - message text.
      e - exception.
    • log

      public final void log(org.apache.log4j.Priority level, Object message)
      Wraps function to Logger.
      Parameters:
      level -
      message -