Package org.compiere.util
Class CLogMgt
- java.lang.Object
-
- org.compiere.util.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
-
-
Constructor Summary
Constructors Constructor Description CLogMgt()
CLogMgt
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addHandler(Handler handler)
Add Handler (to root logger)static void
enable(boolean enableLogging)
Enable/Disable logging (of handlers)protected static Handler[]
getHandlers()
Get Handlersstatic StringBuffer
getInfo(StringBuffer sb)
Get Adempiere System Infostatic StringBuffer
getInfoDetail(StringBuffer sb, Properties ctx)
Create System Infostatic Level
getLevel()
Get logging Level of handlersstatic int
getLevelAsInt()
Get logging Level of handlersstatic void
initialize(boolean isClient)
Initialize Loggingstatic boolean
isLevel(Level level)
Is Logging Level loggedstatic boolean
isLevelAll()
Is Logging Level FINEST loggedstatic boolean
isLevelFine()
Is Logging Level FINE loggedstatic boolean
isLevelFiner()
Is Logging Level FINER loggedstatic boolean
isLevelFinest()
Is Logging Level FINEST loggedstatic boolean
isLevelInfo()
Is Logging Level INFO loggedstatic void
main(String[] args)
Teststatic void
printProperties(Properties p, String description, boolean logIt)
Print Propertiesprotected static void
setFilter(Filter filter)
Set Filter for all handlersprotected static void
setFormatter(Formatter formatter)
Set Formatter for all handlersstatic void
setJDBCDebug(boolean enable)
Set JDBC Debugstatic void
setLevel(int intLevel)
Set Levelstatic void
setLevel(String levelString)
Set Levelstatic void
setLevel(String loggerName, String levelString)
static void
setLevel(String loggerName, Level level)
Set Level for all handlersstatic void
setLevel(Level level)
Set Level for all handlersstatic void
setLoggerLevel(Level level, String loggerNamePart)
Set Level for all Loggersstatic void
shutdown()
Shutdown Logging system
-
-
-
Field Detail
-
LEVELS
public static final Level[] LEVELS
LOG Levels
-
-
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 levelloggerNamePart
- 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
-
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 printdescription
- Description of propertieslogIt
- 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 bufferctx
- Environment- Returns:
- System Info
-
main
public static void main(String[] args)
Test- Parameters:
args
- ignored
-
-