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 intCATEGORY_DEBUGstatic intCATEGORY_ERRORstatic intCATEGORY_FATALstatic intCATEGORY_INFOstatic intCATEGORY_TRACEstatic intCATEGORY_WARNstatic intCUSTOMOnly properties specified to the Log mediatorstatic StringDEFAULT_SEPstatic intFULLall attributes of level 'simple' and the SOAP envelope and any propertiesstatic intHEADERSAll SOAP header blocks and any propertiesstatic intSIMPLETo, 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 voidaddAllProperties(List<MediatorProperty> list)voidaddProperty(MediatorProperty p)intgetCategory()intgetLogLevel()List<MediatorProperty>getProperties()StringgetSeparator()booleanisContentAware()booleanmediate(MessageContext synCtx)Logs the current message according to the supplied semanticsvoidsetCategory(int category)voidsetLogLevel(int logLevel)voidsetSeparator(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:
isContentAwarein interfaceMediator- Overrides:
isContentAwarein classAbstractMediator
-
-