org.apache.synapse.mediators
Class MediatorLog

java.lang.Object
  extended by org.apache.synapse.mediators.MediatorLog
All Implemented Interfaces:
SynapseLog

public class MediatorLog
extends Object
implements SynapseLog

Concrete implementation of the SynapseLog interface appropriate for usage in a mediator. Instances of this class should not be created directly but by using the factory method AbstractMediator.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
MediatorLog(org.apache.commons.logging.Log defaultLog, boolean traceOn, MessageContext synCtx)
           
 
Method Summary
 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 isTraceOrDebugEnabled()
          Check whether a call to SynapseLog.traceOrDebug(Object) would actually cause a log message to be written to the logs.
 boolean isTraceTraceEnabled()
          Check whether a call to SynapseLog.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 to SynapseLog.traceOrDebug(Object) would actually cause a log message to be written to the logs.

Specified by:
isTraceOrDebugEnabled in interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
Parameters:
msg - the message to be logged

isTraceTraceEnabled

public boolean isTraceTraceEnabled()
Description copied from interface: SynapseLog
Check whether a call to SynapseLog.traceTrace(Object) would actually cause a log message to be written to the logs.

Specified by:
isTraceTraceEnabled in interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
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 interface SynapseLog
Parameters:
msg - the message of the exception
cause - the cause of the exception


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.