Class CLogMgt

java.lang.Object
org.compiere.util.CLogMgt

public class CLogMgt extends Object
Contain static methods for iDempiere Log Management.
Version:
$Id: CLogMgt.java,v 1.4 2006/07/30 00:54:36 jjanke Exp $
Author:
Jorg Janke
  • Field Details

    • LEVELS

      public static final Level[] LEVELS
      LOG Levels
  • Constructor Details

    • CLogMgt

      public CLogMgt()
      CLogMgt
  • Method Details

    • getFromLevelMap

      public static Level getFromLevelMap(String name)
      Get from level map loaded from idempiere.properties
      Parameters:
      name - class or package name
      Returns:
      Level or null
    • initialize

      public static void initialize(boolean isClient)
      Initialize Logging
      Parameters:
      isClient - true if running as client
    • getHandlers

      protected static Handler[] getHandlers()
      Get Log Handlers
      Returns:
      handlers
    • addHandler

      public static void addHandler(Handler handler)
      Add Log Handler (to root logger)
      Parameters:
      handler - new Handler
    • setFormatter

      protected static void setFormatter(Formatter formatter)
      Set Formatter for all log handlers
      Parameters:
      formatter - formatter
    • setFilter

      protected static void setFilter(Filter filter)
      Set Filter for all log handlers
      Parameters:
      filter - filter
    • setLoggerLevel

      public static void setLoggerLevel(Level level, String loggerNamePart)
      Set Level for loggers
      Parameters:
      level - log level
      loggerNamePart - optional partial class/logger name
    • setLevel

      public static void setLevel(Level level)
      Set Level for all handlers
      Parameters:
      level - log level
    • setLevel

      public static void setLevel(String loggerName, Level level)
      Set Level for log handlers
      Parameters:
      loggerName - optional partial logger name filter
      level - log level
    • setLevel

      public static void setLevel(int intLevel)
      Set Level
      Parameters:
      intLevel - integer value of level
    • setLevel

      public static void setLevel(String levelString)
      Set Level
      Parameters:
      levelString - string representation of level
    • setLevel

      public static void setLevel(String loggerName, String levelString)
      Set level for loggers
      Parameters:
      loggerName - optional partial logger name filter
      levelString - string representation of level
    • setJDBCDebug

      public static void setJDBCDebug(boolean enable)
      Set JDBC Debug. Auto enable when log level is set to ALL.
      Parameters:
      enable -
    • getLevel

      public static Level getLevel()
      Get logging Level of root logger
      Returns:
      logging level of root logger
    • getLevelAsInt

      public static int getLevelAsInt()
      Get logging Level of root logger
      Returns:
      logging level or root logger
    • isLevel

      public static boolean isLevel(Level level)
      Is Logging Level logged
      Parameters:
      level - level
      Returns:
      true if it is logged
    • isLevelAll

      public static boolean isLevelAll()
      Is Logging Level ALL logged
      Returns:
      true if level ALL is logged
    • isLevelFinest

      public static boolean isLevelFinest()
      Is Logging Level FINEST logged
      Returns:
      true if level FINEST is logged
    • isLevelFiner

      public static boolean isLevelFiner()
      Is Logging Level FINER logged
      Returns:
      true if level FINER is logged
    • isLevelFine

      public static boolean isLevelFine()
      Is Logging Level FINE logged
      Returns:
      true if level FINE is logged
    • isLevelInfo

      public static boolean isLevelInfo()
      Is Logging Level INFO logged
      Returns:
      true if level INFO is logged
    • enable

      public static void enable(boolean enableLogging)
      Deprecated.
      not recommended to use, problematic method to enable/disable the log globally
      Enable/Disable logging (of handlers)
      Parameters:
      enableLogging - true if logging enabled
    • shutdown

      public static void shutdown()
      Shutdown Logging system
    • printProperties

      public static void printProperties(Properties p, String description, boolean logIt)
      Print Properties
      Parameters:
      p - Properties to print
      description - Description of properties
      logIt - if true write to Log (Level.Config), else to System.out
    • getInfo

      public static StringBuffer getInfo(StringBuffer sb)
      Get iDempiere System Info
      Parameters:
      sb - buffer to append or null
      Returns:
      Info as multiple Line String
    • getInfoDetail

      public static StringBuffer getInfoDetail(StringBuffer sb, Properties ctx)
      Create System Info
      Parameters:
      sb - Optional string buffer
      ctx - Environment
      Returns:
      System Info