Stackify Log Filters for Servlets


License

License

GroupId

GroupId

com.stackify
ArtifactId

ArtifactId

stackify-log-servlet
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

Stackify Log Filters for Servlets
Stackify Log Filters for Servlets
Project URL

Project URL

https://github.com/stackify/stackify-log-servlet
Project Organization

Project Organization

Stackify, LLC
Source Code Management

Source Code Management

https://github.com/stackify/stackify-log-servlet

Download stackify-log-servlet

How to add to project

<!-- https://jarcasting.com/artifacts/com.stackify/stackify-log-servlet/ -->
<dependency>
    <groupId>com.stackify</groupId>
    <artifactId>stackify-log-servlet</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.stackify/stackify-log-servlet/
implementation 'com.stackify:stackify-log-servlet:1.1.3'
// https://jarcasting.com/artifacts/com.stackify/stackify-log-servlet/
implementation ("com.stackify:stackify-log-servlet:1.1.3")
'com.stackify:stackify-log-servlet:jar:1.1.3'
<dependency org="com.stackify" name="stackify-log-servlet" rev="1.1.3">
  <artifact name="stackify-log-servlet" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.stackify', module='stackify-log-servlet', version='1.1.3')
)
libraryDependencies += "com.stackify" % "stackify-log-servlet" % "1.1.3"
[com.stackify/stackify-log-servlet "1.1.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.5
com.stackify : stackify-api-java jar 2.1.6

provided (2)

Group / Artifact Type Version
javax.servlet : servlet-api Optional jar 2.5
javax.ws.rs : javax.ws.rs-api Optional jar 2.0.1

test (6)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.5
junit : junit jar 4.11
org.mockito : mockito-core jar 1.9.5
org.powermock : powermock-core jar 1.5.6
org.powermock : powermock-module-junit4 jar 1.5.6
org.powermock : powermock-api-mockito jar 1.5.6

Project Modules

There are no modules declared in this project.

stackify-log-servlet

Maven Central Build Status Coverage Status

This project contains J2EE and JAX-RS servlet filters for capturing web request details that will be attached to log messages that you send to Stackify.

Errors and Logs Overview:

http://support.stackify.com/errors-and-logs-overview/

Sign Up for a Trial:

http://www.stackify.com/sign-up/

stackify-log-servlet needs to be used in conjunction with one of our java logging libraries.

The web request details will be attached to exceptions that are sent to Stackify. Here are the details that we will capture:

  • User
  • User IP address
  • Server name
  • Request protocol
  • Request method (GET, POST, PUT, DELETE)
  • Request URL
  • Referral URL
  • HTTP headers
  • HTTP cookies (names only)
  • HTTP session attributes (names only)
  • Query string parameters

Note: We do not currently capture any details from the POST/PUT body.

In addition to the web request details, we will also generate a transaction id in the filter. This transaction id will be added to all messages that are logged from that request thread. This gives you an easy way to identify all messages that were logged from the same request.

Installation

Add it as a maven dependency:

<dependency>
    <groupId>com.stackify</groupId>
    <artifactId>stackify-log-servlet</artifactId>
    <version>INSERT_LATEST_MAVEN_CENTRAL_VERSION</version>
</dependency>

J2EE Servlet Usage

Add the StackifyLogFilter servlet filter and mapping to the web-app element in your web.xml file.

<web-app>
...
    <filter>
        <filter-name>StackifyLogFilter</filter-name>
        <filter-class>com.stackify.log.servlet.StackifyLogFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>StackifyLogFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
...
</web-app>

JAX-RS Servlet Usage

Add the StackifyLogFilter servlet filter to the servlet element in your web.xml file.

<servlet>
    ...
    <init-param>
        <param-name>jersey.config.server.provider.classnames</param-name>
        <param-value>com.stackify.log.servlet.jaxrs.StackifyLogFilter</param-value>
    </init-param>
    ...
</servlet>

Jersey Note: This will only work with Jersey >= version 2.4 because of the following bug:

License

Copyright 2014 Stackify, LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

com.stackify

Stackify

Stackify helps developers manage and troubleshoot application problems with integrated monitoring, metrics, errors & logs.

Versions

Version
1.1.3
1.1.2
1.1.0
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0