Code Monkey home page Code Monkey logo

spring-boot-logging's Introduction

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

spring-boot-logging's People

Contributors

piomin avatar dependabot[bot] avatar ashraful-islam-rafi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.