Posts by Peter Steman

Correlate your services logging with Spring Boot

Posted on by  
Peter Steman

In a modern service landscape, especially when using containers, you are probably using something like the ELK stack (Elasticsearch, Logstash, Kibana) to flow all the logging into. But how to find from all those loglines what caused the nasty bug after a innocent buttonpress? One of the easy answers to this is what’s called a correlation id - basically a unique number assigned to that buttonpress which gets carried around between the services and added to every logline. Sounds good you say? it is so let’s see how to do this. First we need to generate and send the correlation id from the browser. To do this in a transparent way we add a header with every request to the backend and put a unique id (UUID is mostly used) in it. Below is a piece of AngularJS code to do this:

Continue reading →