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
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
clazzname
protected int
configuredLogLevel
The configured log levelprotected int
currentLogLevel
The current log level(package private) LogManager
lm
static int
LOG_LEVEL_ALL
Enable all logging levelsstatic int
LOG_LEVEL_DEBUG
"Debug" level logging.static int
LOG_LEVEL_ERROR
"Error" level logging.static int
LOG_LEVEL_FATAL
"Fatal" level logging.static int
LOG_LEVEL_INFO
"Info" level logging.static int
LOG_LEVEL_OFF
Enable no logging levelsstatic int
LOG_LEVEL_TRACE
"Trace" level logging.static int
LOG_LEVEL_WARN
"Warn" level logging.protected static java.util.Properties
openas2LogProps
Properties loaded from simplelog.propertiesprotected static java.lang.String
systemPrefix
All system properties used byOpenAS2
start 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 void
debug(java.lang.Object message)
void
debug(java.lang.Object message, java.lang.Throwable t)
void
error(java.lang.Object message)
void
error(java.lang.Object message, java.lang.Throwable t)
void
fatal(java.lang.Object message)
void
fatal(java.lang.Object message, java.lang.Throwable t)
static java.lang.String
getExceptionMsg(java.lang.Throwable e)
private static int
getIntLogLevel(java.lang.String lvl)
int
getLevel()
Get logging level.private static java.io.InputStream
getResourceAsStream(java.lang.String name)
private static java.lang.String
getStringProperty(java.lang.String name)
void
info(java.lang.Object message)
void
info(java.lang.Object message, java.lang.Throwable t)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isFatalEnabled()
boolean
isInfoEnabled()
protected boolean
isLevelEnabled(int logLevel)
boolean
isTraceEnabled()
boolean
isWarnEnabled()
void
resetLevel()
Reset logging level to congiured level.void
setLevel(int currentLogLevel)
Set logging level.void
trace(java.lang.Object message)
void
trace(java.lang.Object message, java.lang.Throwable t)
void
warn(java.lang.Object message)
void
warn(java.lang.Object message, java.lang.Throwable t)
-
-
-
Field Detail
-
lm
LogManager lm
-
clazzname
java.lang.String clazzname
-
systemPrefix
protected static final java.lang.String systemPrefix
All system properties used byOpenAS2
start 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
-
getIntLogLevel
private static int getIntLogLevel(java.lang.String lvl)
-
getStringProperty
private static java.lang.String getStringProperty(java.lang.String name)
-
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:
trace
in interfaceorg.apache.commons.logging.Log
-
trace
public void trace(java.lang.Object message, java.lang.Throwable t)
- Specified by:
trace
in interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message)
- Specified by:
debug
in interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message, java.lang.Throwable t)
- Specified by:
debug
in interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message)
- Specified by:
info
in interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message, java.lang.Throwable t)
- Specified by:
info
in interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message)
- Specified by:
warn
in interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)
- Specified by:
warn
in interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message)
- Specified by:
error
in interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message, java.lang.Throwable t)
- Specified by:
error
in interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message)
- Specified by:
fatal
in interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message, java.lang.Throwable t)
- Specified by:
fatal
in interfaceorg.apache.commons.logging.Log
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabled
in interfaceorg.apache.commons.logging.Log
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabled
in interfaceorg.apache.commons.logging.Log
-
isFatalEnabled
public boolean isFatalEnabled()
- Specified by:
isFatalEnabled
in interfaceorg.apache.commons.logging.Log
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabled
in interfaceorg.apache.commons.logging.Log
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabled
in interfaceorg.apache.commons.logging.Log
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabled
in interfaceorg.apache.commons.logging.Log
-
getResourceAsStream
private static java.io.InputStream getResourceAsStream(java.lang.String name)
-
getExceptionMsg
public static java.lang.String getExceptionMsg(java.lang.Throwable e)
-
-