Package org.openas2.logging
Class BaseLogger
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.logging.BaseLogger
-
- Direct Known Subclasses:
ConsoleLogger
,EmailLogger
,FileLogger
,SocketLogger
public abstract class BaseLogger extends BaseComponent implements Logger
-
-
Field Summary
Fields Modifier and Type Field Description private Formatter
formatter
private boolean
logExceptionTrace
static java.lang.String
PARAM_EXCEPTIONS
static java.lang.String
PARAM_SHOW
static java.lang.String
VALUE_SHOW_ALL
static java.lang.String
VALUE_SHOW_EXCEPTIONS
static java.lang.String
VALUE_SHOW_INFO
static java.lang.String
VALUE_SHOW_TERMINATED
-
Constructor Summary
Constructors Constructor Description BaseLogger()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doLog(java.lang.Throwable throwable, boolean terminated)
protected abstract void
doLog(Level level, java.lang.String msgText, Message message)
Formatter
getFormatter()
protected abstract java.lang.String
getShowDefaults()
void
init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters)
Component lifecycle hook.boolean
isLogExceptionTrace()
protected boolean
isLogging(OpenAS2Exception exception)
protected boolean
isShowing(java.lang.String value)
void
log(java.lang.Throwable t, Level level, boolean terminated)
void
log(Level level, java.lang.String msgText, Message message, java.lang.Throwable t)
level msgText messagevoid
setFormatter(Formatter formatter)
void
setLogExceptionTrace(boolean logExceptionTrace)
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openas2.Component
destroy, getName, getParameters, getSession
-
-
-
-
Field Detail
-
PARAM_EXCEPTIONS
public static final java.lang.String PARAM_EXCEPTIONS
- See Also:
- Constant Field Values
-
PARAM_SHOW
public static final java.lang.String PARAM_SHOW
- See Also:
- Constant Field Values
-
VALUE_SHOW_ALL
public static final java.lang.String VALUE_SHOW_ALL
- See Also:
- Constant Field Values
-
VALUE_SHOW_TERMINATED
public static final java.lang.String VALUE_SHOW_TERMINATED
- See Also:
- Constant Field Values
-
VALUE_SHOW_EXCEPTIONS
public static final java.lang.String VALUE_SHOW_EXCEPTIONS
- See Also:
- Constant Field Values
-
VALUE_SHOW_INFO
public static final java.lang.String VALUE_SHOW_INFO
- See Also:
- Constant Field Values
-
formatter
private Formatter formatter
-
logExceptionTrace
private boolean logExceptionTrace
-
-
Method Detail
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters) throws OpenAS2Exception
Description copied from interface:Component
Component lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
init
in interfaceComponent
- Overrides:
init
in classBaseComponent
- Parameters:
session
- the component uses this object to access other componentsparameters
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
isLogExceptionTrace
public boolean isLogExceptionTrace()
-
setLogExceptionTrace
public void setLogExceptionTrace(boolean logExceptionTrace)
-
setFormatter
public void setFormatter(Formatter formatter)
- Specified by:
setFormatter
in interfaceLogger
-
getFormatter
public Formatter getFormatter()
- Specified by:
getFormatter
in interfaceLogger
-
log
public void log(java.lang.Throwable t, Level level, boolean terminated)
-
log
public void log(Level level, java.lang.String msgText, Message message, java.lang.Throwable t)
level msgText message
-
isLogging
protected boolean isLogging(OpenAS2Exception exception)
-
getShowDefaults
protected abstract java.lang.String getShowDefaults()
-
isShowing
protected boolean isShowing(java.lang.String value)
-
doLog
protected abstract void doLog(java.lang.Throwable throwable, boolean terminated)
-
-