How to generate centralized logs for spring boot microservices?

Viewed 8792

Suppose I have a micro service 1 running in server A and and service 2 is running in server B. The UI/client code is deployed in server 3. I would like to generate the logs for both the micro services in my UI server. However individual logs are generated for microservices in their own servers as mentioned in applications.properties , logging.path.

Question is how can we generate all logs in one place, say in UI /client server.Can it be be achieved in spring cloud config? or if not , can you help me mentioning some steps.?

4 Answers

the easiest way to go is by using spring boot admin, your logs will be exposed via an Actuator endpoint so that you see all your logs from admin console.

spring boot admin

You would deploy a central logging server (e.g. Graylog https://www.graylog.org/). Then add a logging appender to every microservice, that will report to the logging server.

Quite popular solution is ELK stack.

There are so many options available in market ..

if you are looking for logging with analytics , log monitoring and alerts - then you can use centralized system for logs.

Centralized system such as Splunk or Stackify - are very good at logging and effective handling.

There is one more platform called - Loggly , it is kind of Laas - logging as a service

For ex to start with you can check out the implementation for splunk -

Overview

http://dev.splunk.com/view/splunk-logging-java/SP-CAAAE2K

implementation

http://dev.splunk.com/view/splunk-logging-java/SP-CAAAE3R
Related