-
Notifications
You must be signed in to change notification settings - Fork 50
Instrumenting Servlets
altenhof edited this page Mar 24, 2016
·
12 revisions
Servlet instrumentation is implemented as a standard servlet filter as defined in the Java Servlet Specification, Version 3.0 .
In order to make this feature available in your application, you need to add the corresponding library to your Maven dependencies in your application's pom.xml
like this, assuming that you've also defined a property cf-logging-version
that refers to the latest version of this feature:
<!-- We're using the Servlet Filter instrumentation -->
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${cf-logging-version}</version>
</dependency>
The easiest way to enable that servlet filter is to declare it in your application's web.xml
file. To do so, add the following lines to that file, as we've done in the sample application:
<filter-name>request-logging</filter-name>
<filter-class>com.sap.hcp.cf.logging.servlet.filter.RequestLoggingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>request-logging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>