Class LogMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.builtin.LogMediator
-
- All Implemented Interfaces:
AspectConfigurable
,Mediator
,SynapseArtifact
public class LogMediator extends AbstractMediator
Logs the specified message into the configured logger. The log levels specify which attributes would be logged, and is configurable. Additionally custom properties may be defined to the logger, where literal values or expressions could be specified for logging. The custom properties are printed into the log using the defined separator (\n, "," etc)
-
-
Field Summary
Fields Modifier and Type Field Description static int
CATEGORY_DEBUG
static int
CATEGORY_ERROR
static int
CATEGORY_FATAL
static int
CATEGORY_INFO
static int
CATEGORY_TRACE
static int
CATEGORY_WARN
static int
CUSTOM
Only properties specified to the Log mediatorstatic String
DEFAULT_SEP
static int
FULL
all attributes of level 'simple' and the SOAP envelope and any propertiesstatic int
HEADERS
All SOAP header blocks and any propertiesstatic int
SIMPLE
To, From, WSAction, SOAPAction, ReplyTo, MessageID and any properties-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description LogMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllProperties(List<MediatorProperty> list)
void
addProperty(MediatorProperty p)
int
getCategory()
int
getLogLevel()
List<MediatorProperty>
getProperties()
String
getSeparator()
boolean
isContentAware()
boolean
mediate(MessageContext synCtx)
Logs the current message according to the supplied semanticsvoid
setCategory(int category)
void
setLogLevel(int logLevel)
void
setSeparator(String separator)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Field Detail
-
CUSTOM
public static final int CUSTOM
Only properties specified to the Log mediator- See Also:
- Constant Field Values
-
SIMPLE
public static final int SIMPLE
To, From, WSAction, SOAPAction, ReplyTo, MessageID and any properties- See Also:
- Constant Field Values
-
HEADERS
public static final int HEADERS
All SOAP header blocks and any properties- See Also:
- Constant Field Values
-
FULL
public static final int FULL
all attributes of level 'simple' and the SOAP envelope and any properties- See Also:
- Constant Field Values
-
CATEGORY_INFO
public static final int CATEGORY_INFO
- See Also:
- Constant Field Values
-
CATEGORY_DEBUG
public static final int CATEGORY_DEBUG
- See Also:
- Constant Field Values
-
CATEGORY_TRACE
public static final int CATEGORY_TRACE
- See Also:
- Constant Field Values
-
CATEGORY_WARN
public static final int CATEGORY_WARN
- See Also:
- Constant Field Values
-
CATEGORY_ERROR
public static final int CATEGORY_ERROR
- See Also:
- Constant Field Values
-
CATEGORY_FATAL
public static final int CATEGORY_FATAL
- See Also:
- Constant Field Values
-
DEFAULT_SEP
public static final String DEFAULT_SEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
Logs the current message according to the supplied semantics- Parameters:
synCtx
- (current) message to be logged- Returns:
- true always
-
getLogLevel
public int getLogLevel()
-
setLogLevel
public void setLogLevel(int logLevel)
-
getSeparator
public String getSeparator()
-
setSeparator
public void setSeparator(String separator)
-
addProperty
public void addProperty(MediatorProperty p)
-
addAllProperties
public void addAllProperties(List<MediatorProperty> list)
-
getProperties
public List<MediatorProperty> getProperties()
-
getCategory
public int getCategory()
-
setCategory
public void setCategory(int category)
-
isContentAware
public boolean isContentAware()
- Specified by:
isContentAware
in interfaceMediator
- Overrides:
isContentAware
in classAbstractMediator
-
-