Open Source API Gateway
5. Monitoring, Logging and Statistics

log

Version

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.

Syntax

<log body="[false,true]" category="[string]" level="[TRACE,DEBUG,INFO,WARN,ERROR,FATAL]" />
<log message="Path: ${path}" />
<log body="[false,true]" category="[string]" level="[TRACE,DEBUG,INFO,WARN,ERROR,FATAL]" />
<log message="Path: ${path}" />

Sample

<serviceProxy port="2000">
<request>
<log />
</request>
<target host="www.predic8.de" />
</serviceProxy>
<serviceProxy port="2000">
  <request>
	<log />
  </request>
  <target host="www.predic8.de" />
</serviceProxy>

Attributes

NameRequiredDefaultDescriptionExamples
categoryfalsecom.predic8.membrane.core.interceptor.LogInterceptorSets the category of the logged message.Membrane
headerOnlyfalsetrueIf set to true only the HTTP header will be logged.-
levelfalseINFOSets the log level.WARN

Can be used in