Class CLogMgt


  • public class CLogMgt
    extends Object
    idempiere Log Management.
    Version:
    $Id: CLogMgt.java,v 1.4 2006/07/30 00:54:36 jjanke Exp $
    Author:
    Jorg Janke
    • Field Detail

      • LEVELS

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

      • CLogMgt

        public CLogMgt()
        CLogMgt
    • Method Detail

      • initialize

        public static void initialize​(boolean isClient)
        Initialize Logging
        Parameters:
        isClient - client
      • getHandlers

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

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

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

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

        public static void setLoggerLevel​(Level level,
                                          String loggerNamePart)
        Set Level for all 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 all handlers
        Parameters:
        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)
      • setJDBCDebug

        public static void setJDBCDebug​(boolean enable)
        Set JDBC Debug
        Parameters:
        enable -
      • getLevel

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

        public static int getLevelAsInt()
        Get logging Level of handlers
        Returns:
        logging level
      • 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 FINEST logged
        Returns:
        true if it is logged
      • isLevelFinest

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

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

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

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

        public static void enable​(boolean enableLogging)
        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 Adempiere 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
      • main

        public static void main​(String[] args)
        Test
        Parameters:
        args - ignored