Package org.openas2.logging
Class Log
- java.lang.Object
-
- org.openas2.logging.Log
-
- All Implemented Interfaces:
org.apache.commons.logging.Log
public class Log extends java.lang.Object implements org.apache.commons.logging.Log- Author:
- joseph mcverry
-
-
Field Summary
Fields Modifier and Type Field Description protected intconfiguredLogLevelThe configured log levelprotected intcurrentLogLevelThe current log levelstatic intLOG_LEVEL_ALLEnable all logging levelsstatic intLOG_LEVEL_DEBUG"Debug" level logging.static intLOG_LEVEL_ERROR"Error" level logging.static intLOG_LEVEL_FATAL"Fatal" level logging.static intLOG_LEVEL_INFO"Info" level logging.static intLOG_LEVEL_OFFEnable no logging levelsstatic intLOG_LEVEL_TRACE"Trace" level logging.static intLOG_LEVEL_WARN"Warn" level logging.protected static java.util.Propertiesopenas2LogPropsProperties loaded from simplelog.propertiesprotected static java.lang.StringsystemPrefixAll system properties used byOpenAS2start with this
-
Constructor Summary
Constructors Constructor Description Log(java.lang.String inName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.Object message)voiddebug(java.lang.Object message, java.lang.Throwable t)voiderror(java.lang.Object message)voiderror(java.lang.Object message, java.lang.Throwable t)voidfatal(java.lang.Object message)voidfatal(java.lang.Object message, java.lang.Throwable t)static java.lang.StringgetExceptionMsg(java.lang.Throwable e)intgetLevel()Get logging level.voidinfo(java.lang.Object message)voidinfo(java.lang.Object message, java.lang.Throwable t)booleanisDebugEnabled()booleanisErrorEnabled()booleanisFatalEnabled()booleanisInfoEnabled()protected booleanisLevelEnabled(int logLevel)booleanisTraceEnabled()booleanisWarnEnabled()voidresetLevel()Reset logging level to congiured level.voidsetLevel(int currentLogLevel)Set logging level.voidtrace(java.lang.Object message)voidtrace(java.lang.Object message, java.lang.Throwable t)voidwarn(java.lang.Object message)voidwarn(java.lang.Object message, java.lang.Throwable t)
-
-
-
Field Detail
-
systemPrefix
protected static final java.lang.String systemPrefix
All system properties used byOpenAS2start with this- See Also:
- Constant Field Values
-
openas2LogProps
protected static final java.util.Properties openas2LogProps
Properties loaded from simplelog.properties
-
LOG_LEVEL_TRACE
public static final int LOG_LEVEL_TRACE
"Trace" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_DEBUG
"Debug" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_INFO
public static final int LOG_LEVEL_INFO
"Info" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_WARN
public static final int LOG_LEVEL_WARN
"Warn" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_ERROR
public static final int LOG_LEVEL_ERROR
"Error" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_FATAL
public static final int LOG_LEVEL_FATAL
"Fatal" level logging.- See Also:
- Constant Field Values
-
LOG_LEVEL_ALL
public static final int LOG_LEVEL_ALL
Enable all logging levels- See Also:
- Constant Field Values
-
LOG_LEVEL_OFF
public static final int LOG_LEVEL_OFF
Enable no logging levels- See Also:
- Constant Field Values
-
configuredLogLevel
protected volatile int configuredLogLevel
The configured log level
-
currentLogLevel
protected volatile int currentLogLevel
The current log level
-
-
Method Detail
-
resetLevel
public void resetLevel()
Reset logging level to congiured level.
-
setLevel
public void setLevel(int currentLogLevel)
Set logging level.- Parameters:
currentLogLevel- new logging level
-
getLevel
public int getLevel()
Get logging level.- Returns:
- the current logging level
-
isLevelEnabled
protected boolean isLevelEnabled(int logLevel)
-
trace
public void trace(java.lang.Object message)
- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
trace
public void trace(java.lang.Object message, java.lang.Throwable t)- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message)
- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message, java.lang.Throwable t)- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message)
- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message, java.lang.Throwable t)- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message)
- Specified by:
warnin interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)- Specified by:
warnin interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message)
- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message, java.lang.Throwable t)- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message)
- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message, java.lang.Throwable t)- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin interfaceorg.apache.commons.logging.Log
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabledin interfaceorg.apache.commons.logging.Log
-
isFatalEnabled
public boolean isFatalEnabled()
- Specified by:
isFatalEnabledin interfaceorg.apache.commons.logging.Log
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabledin interfaceorg.apache.commons.logging.Log
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabledin interfaceorg.apache.commons.logging.Log
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabledin interfaceorg.apache.commons.logging.Log
-
getExceptionMsg
public static java.lang.String getExceptionMsg(java.lang.Throwable e)
-
-