Package org.compiere.util
Class CLogMgt
java.lang.Object
org.compiere.util.CLogMgt
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addHandler
(Handler handler) Add Handler (to root logger)static void
enable
(boolean enableLogging) Deprecated.not recommended to use, problematic method to enable/disable the log globallyprotected static Handler[]
Get Handlersstatic StringBuffer
getInfo
(StringBuffer sb) Get iDempiere System Infostatic StringBuffer
getInfoDetail
(StringBuffer sb, Properties ctx) Create System Infostatic Level
getLevel()
Get logging Level of root loggerstatic int
Get logging Level of root loggerstatic void
initialize
(boolean isClient) Initialize Loggingstatic boolean
Is Logging Level loggedstatic boolean
Is Logging Level ALL loggedstatic boolean
Is Logging Level FINE loggedstatic boolean
Is Logging Level FINER loggedstatic boolean
Is Logging Level FINEST loggedstatic boolean
Is Logging Level INFO loggedstatic void
printProperties
(Properties p, String description, boolean logIt) Print Propertiesprotected static void
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
Set Levelstatic void
Set level for loggersstatic void
Set Level for handlersstatic void
Set Level for all handlersstatic void
setLoggerLevel
(Level level, String loggerNamePart) Set Level for loggersstatic void
shutdown()
Shutdown Logging system
-
Field Details
-
LEVELS
LOG Levels
-
-
Constructor Details
-
CLogMgt
public CLogMgt()CLogMgt
-
-
Method Details
-
initialize
public static void initialize(boolean isClient) Initialize Logging- Parameters:
isClient
- true if running as client
-
getHandlers
Get Handlers- Returns:
- handlers
-
addHandler
Add Handler (to root logger)- Parameters:
handler
- new Handler
-
setFormatter
Set Formatter for all handlers- Parameters:
formatter
- formatter
-
setFilter
Set Filter for all handlers- Parameters:
filter
- filter
-
setLoggerLevel
Set Level for loggers- Parameters:
level
- log levelloggerNamePart
- optional partial class/logger name
-
setLevel
Set Level for all handlers- Parameters:
level
- log level
-
setLevel
Set Level for handlers- Parameters:
loggerName
- optional partial logger name filterlevel
- log level
-
setLevel
public static void setLevel(int intLevel) Set Level- Parameters:
intLevel
- integer value of level
-
setLevel
Set Level- Parameters:
levelString
- string representation of level
-
setLevel
Set level for loggers- Parameters:
loggerName
- optional partial logger name filterlevelString
- string representation of level
-
setJDBCDebug
public static void setJDBCDebug(boolean enable) Set JDBC Debug- Parameters:
enable
-
-
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
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 globallyEnable/Disable logging (of handlers)- Parameters:
enableLogging
- true if logging enabled
-
shutdown
public static void shutdown()Shutdown Logging system -
printProperties
Print Properties- Parameters:
p
- Properties to printdescription
- Description of propertieslogIt
- if true write to Log (Level.Config), else to System.out
-
getInfo
Get iDempiere System Info- Parameters:
sb
- buffer to append or null- Returns:
- Info as multiple Line String
-
getInfoDetail
Create System Info- Parameters:
sb
- Optional string bufferctx
- Environment- Returns:
- System Info
-