Skip to content

Example of centralized logging with Spring Boot and GrayLog

Notifications You must be signed in to change notification settings

SanoranX/spring_graylog_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example workflow

Graylog + Spring Boot Example

This repository demonstrates a sample implementation of Spring Centralized Logging to Graylog. In this example, Graylog is run using Docker Compose. However, in production, it can be installed as a standalone application.

How-To Run

  1. Start docker-compose by running following in your terminal
docker-compose up -d
  1. Open your browser and go to http://localhost:9000.
  2. After that, add a new GELF input.
  3. Finally, run the application and you will be able to see the logs in Graylog

How it works

The implementation is straightforward. It utilizes the GLF appender to add all logs with a specific level to the GELF port of Graylog. There is no requirement to exclude the default Spring Logging, as everything works seamlessly. You can create multiple appenders for various environments such as stage, development, production, and others. If you do not wish to save your local logs in Graylog, you can create a new file named application-dev.properties and add the necessary logback configuration. After which, you can run the .jar file with the required properties file and delete all settings from the original application.properties.

About

Example of centralized logging with Spring Boot and GrayLog

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages