logstash-logging-spring-boot-starter

Library for HTTP logging with Spring Boot

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы Logging Библиотеки уровня приложения Logstash
Группа

Группа

com.github.piomin
Идентификатор

Идентификатор

logstash-logging-spring-boot-starter
Последняя версия

Последняя версия

1.3.0.RELEASE
Дата

Дата

Тип

Тип

jar
Описание

Описание

logstash-logging-spring-boot-starter
Library for HTTP logging with Spring Boot
Ссылка на сайт

Ссылка на сайт

https://github.com/piomin/spring-boot-logging
Система контроля версий

Система контроля версий

https://github.com/piomin/spring-boot-logging

Скачать logstash-logging-spring-boot-starter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.piomin/logstash-logging-spring-boot-starter/ -->
<dependency>
    <groupId>com.github.piomin</groupId>
    <artifactId>logstash-logging-spring-boot-starter</artifactId>
    <version>1.3.0.RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.piomin/logstash-logging-spring-boot-starter/
implementation 'com.github.piomin:logstash-logging-spring-boot-starter:1.3.0.RELEASE'
// https://jarcasting.com/artifacts/com.github.piomin/logstash-logging-spring-boot-starter/
implementation ("com.github.piomin:logstash-logging-spring-boot-starter:1.3.0.RELEASE")
'com.github.piomin:logstash-logging-spring-boot-starter:jar:1.3.0.RELEASE'
<dependency org="com.github.piomin" name="logstash-logging-spring-boot-starter" rev="1.3.0.RELEASE">
  <artifact name="logstash-logging-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.piomin', module='logstash-logging-spring-boot-starter', version='1.3.0.RELEASE')
)
libraryDependencies += "com.github.piomin" % "logstash-logging-spring-boot-starter" % "1.3.0.RELEASE"
[com.github.piomin/logstash-logging-spring-boot-starter "1.3.0.RELEASE"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
net.logstash.logback : logstash-logback-encoder jar 5.3
commons-io : commons-io jar 2.6
org.slf4j : slf4j-api jar 1.7.26
ch.qos.logback : logback-classic jar 1.2.3
javax.annotation : javax.annotation-api jar 1.3.2

provided (5)

Идентификатор библиотеки Тип Версия
org.springframework : spring-context jar 5.2.3.RELEASE
org.springframework : spring-web jar 5.2.3.RELEASE
org.springframework : spring-webmvc jar 5.2.3.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.1.4.RELEASE
javax.servlet : javax.servlet-api jar 4.0.1

Модули Проекта

Данный проект не имеет модулей.

Logging with Spring Boot and Elastic Stack Twitter

Maven Central CircleCI Quality Gate Status Maintainability Rating Reliability Rating

Main purpose

This library is created for logging incoming HTTP requests and outgoing HTTP responses and send these logs automatically to Logstash.

Articles

Detailed description can be found here:

  1. Logging with Spring Boot and Elastic Stack
  2. Using logstash-logging-spring-boot-starter for logging with Spring Boot and Logstash

Features

In short, let’s begin from a brief review of main features provided by logstash-logging-spring-boot-starter:

  1. It is able to log all incoming HTTP requests and outgoing HTTP responses with full body, and send those logs to Logstash with the proper tags
  2. It is able to calculate and store an execution time for each request
  3. It generates and propagates correlationId for downstream services calling with Spring RestTemplate or OpenFeign
  4. It is auto-configurable Spring Boot library – you don’t have to do anything more than including it as a dependency to your application to make it work

Getting started

The library is published on Maven Central. Current version is 1.2.2.RELEASE

<dependency>
  <groupId>com.github.piomin</groupId>
  <artifactId>logstash-logging-spring-boot-starter</artifactId>
  <version>1.2.2.RELEASE</version>
</dependency>

By default the library is enabled, but tries to locate Logback configuration inside your application to settings for Logstash appender. If such appender won’t be found, the library uses Spring Boot default logging configuration, which does not include Logstash appender. To force it use auto-configured appender definition inside library we have to set property logging.logstash.enabled to true.

logging.logstash:
  enabled: true
  url: 192.168.99.100:5000

Версии библиотеки

Версия
1.3.0.RELEASE
1.2.2.RELEASE
1.2.1.RELEASE
1.2.0.RELEASE