Package org.apache.synapse.mediators
Class MediatorLog
- java.lang.Object
-
- org.apache.synapse.mediators.MediatorLog
-
- All Implemented Interfaces:
SynapseLog
public class MediatorLog extends Object implements SynapseLog
Concrete implementation of theSynapseLog
interface appropriate for usage in a mediator. Instances of this class should not be created directly but by using the factory methodAbstractMediator.getLog(org.apache.synapse.MessageContext)
.Note that this is work in progress. Please refer to https://issues.apache.org/jira/browse/SYNAPSE-374 for more information.
-
-
Constructor Summary
Constructors Constructor Description MediatorLog(org.apache.commons.logging.Log defaultLog, boolean traceOn, MessageContext synCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
auditDebug(Object msg)
Log a message at level DEBUG to all available/enabled logs.void
auditError(Object msg)
Log a message at level ERROR to all available/enabled logs.void
auditFatal(Object msg)
Log a message at level FATAL to all available/enabled logs.void
auditLog(Object msg)
Log a message at level INFO to all available/enabled logs.void
auditTrace(Object msg)
Log a message at level TRACE to all available/enabled logs.void
auditWarn(Object msg)
Log a message at level WARN to all available/enabled logs.void
error(Object msg)
Log a message at level ERROR to the default log and to the trace, if trace is enabled.boolean
isDebugEnabled()
Check whether a call to#debug(Object)
would actually cause a log message to be written to the logs.boolean
isTraceEnabled()
Check whether a call to#trace(Object)
would actually cause a log message to be written to the logs.boolean
isTraceOrDebugEnabled()
Check whether a call toSynapseLog.traceOrDebug(Object)
would actually cause a log message to be written to the logs.boolean
isTraceTraceEnabled()
Check whether a call toSynapseLog.traceTrace(Object)
would actually cause a log message to be written to the logs.void
logSynapseException(String msg, Throwable cause)
Log a message at level ERROR to the default log, the service log and the trace, if trace is enabled.void
traceOrDebug(Object msg)
Log a message to the default log at level DEBUG and and to the trace log at level INFO if trace is enabled for the mediator.void
traceOrDebugWarn(Object msg)
Log a message at level WARN to the default log, if level DEBUG is enabled, and to the trace log, if trace is enabled for the mediator.void
traceTrace(Object msg)
Log a message to the trace log at level TRACE if trace is enabled for the mediator.
-
-
-
Constructor Detail
-
MediatorLog
public MediatorLog(org.apache.commons.logging.Log defaultLog, boolean traceOn, MessageContext synCtx)
-
-
Method Detail
-
isTraceOrDebugEnabled
public boolean isTraceOrDebugEnabled()
Description copied from interface:SynapseLog
Check whether a call toSynapseLog.traceOrDebug(Object)
would actually cause a log message to be written to the logs.- Specified by:
isTraceOrDebugEnabled
in interfaceSynapseLog
- Returns:
true
if trace or debug is enabled
-
isDebugEnabled
public boolean isDebugEnabled()
Description copied from interface:SynapseLog
Check whether a call to#debug(Object)
would actually cause a log message to be written to the logs.- Specified by:
isDebugEnabled
in interfaceSynapseLog
- Returns:
true
if trace or debug is enabled
-
isTraceEnabled
public boolean isTraceEnabled()
Description copied from interface:SynapseLog
Check whether a call to#trace(Object)
would actually cause a log message to be written to the logs.- Specified by:
isTraceEnabled
in interfaceSynapseLog
- Returns:
true
if trace or debug is enabled
-
traceOrDebug
public void traceOrDebug(Object msg)
Log a message to the default log at level DEBUG and and to the trace log at level INFO if trace is enabled for the mediator.- Specified by:
traceOrDebug
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
traceOrDebugWarn
public void traceOrDebugWarn(Object msg)
Log a message at level WARN to the default log, if level DEBUG is enabled, and to the trace log, if trace is enabled for the mediator.- Specified by:
traceOrDebugWarn
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
isTraceTraceEnabled
public boolean isTraceTraceEnabled()
Description copied from interface:SynapseLog
Check whether a call toSynapseLog.traceTrace(Object)
would actually cause a log message to be written to the logs.- Specified by:
isTraceTraceEnabled
in interfaceSynapseLog
- Returns:
true
if trace is enabled for the trace log
-
traceTrace
public void traceTrace(Object msg)
Log a message to the trace log at level TRACE if trace is enabled for the mediator.- Specified by:
traceTrace
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditLog
public void auditLog(Object msg)
Log a message at level INFO to all available/enabled logs.- Specified by:
auditLog
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditDebug
public void auditDebug(Object msg)
Log a message at level DEBUG to all available/enabled logs.- Specified by:
auditDebug
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditTrace
public void auditTrace(Object msg)
Log a message at level TRACE to all available/enabled logs.- Specified by:
auditTrace
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditWarn
public void auditWarn(Object msg)
Log a message at level WARN to all available/enabled logs.- Specified by:
auditWarn
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditError
public void auditError(Object msg)
Log a message at level ERROR to all available/enabled logs.- Specified by:
auditError
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
auditFatal
public void auditFatal(Object msg)
Log a message at level FATAL to all available/enabled logs.- Specified by:
auditFatal
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
error
public void error(Object msg)
Log a message at level ERROR to the default log and to the trace, if trace is enabled.- Specified by:
error
in interfaceSynapseLog
- Parameters:
msg
- the message to be logged
-
logSynapseException
public void logSynapseException(String msg, Throwable cause)
Log a message at level ERROR to the default log, the service log and the trace, if trace is enabled.- Specified by:
logSynapseException
in interfaceSynapseLog
- Parameters:
msg
- the message of the exceptioncause
- the cause of the exception
-
-