Class LogInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.LogInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- The log feature logs request and response messages to the log4j framework. The messages will appear either on the console or in a log file depending on the configuration of the conf/log4j2.xml file.
- Topic
- 5. Monitoring, Logging and Statistics
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLevel()voidhandleAbort(Exchange exc) Called when anyInterceptor.handleRequest(Exchange)orInterceptor.handleResponse(Exchange)later in the chain returnedOutcome.ABORTor threw an exception.handleRequest(Exchange exc) handleResponse(Exchange exc) booleanvoidsetCategory(String category) voidsetHeaderOnly(boolean headerOnly) voidsetLevel(LogInterceptor.Level level) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, init, init, setDisplayName, setFlow
-
Constructor Details
-
LogInterceptor
public LogInterceptor()
-
-
Method Details
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-
handleAbort
Description copied from interface:InterceptorCalled when anyInterceptor.handleRequest(Exchange)orInterceptor.handleResponse(Exchange)later in the chain returnedOutcome.ABORTor threw an exception.handleAbort is called in the reverse order of the chain (as handleResponse is).
- Specified by:
handleAbortin interfaceInterceptor- Overrides:
handleAbortin classAbstractInterceptor
-
isHeaderOnly
public boolean isHeaderOnly() -
setHeaderOnly
public void setHeaderOnly(boolean headerOnly) - Default
- true
- Description
- If set to true only the HTTP header will be logged.
-
getLevel
-
setLevel
- Default
- INFO
- Description
- Sets the log level.
- Example
- WARN
-
getCategory
-
setCategory
- Default
- com.predic8.membrane.core.interceptor.LogInterceptor
- Description
- Sets the category of the logged message.
- Example
- Membrane
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-