Request Logging

Project helps in following request throughout a microservice architecture.

License

License

Categories

Categories

Logging Application Layer Libs
GroupId

GroupId

de.codeboje
ArtifactId

ArtifactId

request-logging
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Request Logging
Project helps in following request throughout a microservice architecture.
Project URL

Project URL

https://github.com/azarai/request-logging
Project Organization

Project Organization

codeboje.de
Source Code Management

Source Code Management

https://github.com/azarai/request-logging.git

Download request-logging

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.13
org.apache.commons : commons-lang3 jar 3.0
org.springframework : spring-web jar 4.3.9.RELEASE

provided (1)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.0.1

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 2.8.47
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

Poor man's logging for inter Microservice requests.

In a microservice system, it s often not clear which way a specific user request took and debugging can be a nightmare. This module helps you in assigning a unique identifier to a request and passing it along. The identifier is stored in the MDC and can be used in logback as a user variable in the log pattern.

Dependency:

<dependency>
  <groupId>de.codeboje</groupId>
  <artifactId>request-logging</artifactId>
  <version>0.0.1</version>
</dependency>

Usage:

Filter:

  1. Add the RequestContextLoggingFilter as a Servlet Filter
  2. add requestId as a user variable to your logback log pattern
  3. Send the request header X-REQUEST-ID with each request

Interceptor:

  1. Add the RequestContextLoggingInterceptor to your Spring RestTemplate
  2. Set requestId in the MDC or use an autogenerated value per request

Versions

Version
0.0.1