Java Log file tailer (tail -f) in Spring Boot

Mihaita Tinta
Javarevisited
Published in
4 min readAug 19, 2021

--

In this article, we will focus on streaming file changes on a Spring Boot endpoint. You probably used the tail -f command to follow the changes in a file. We will see the same output from our new endpoint.

The most simple approach is to return the content we read from a file in our endpoint. This feature is already available here in Spring Boot Actuator based on this class.

--

--

Mihaita Tinta
Javarevisited

A new kind of plumber working with Java, Spring, Kubernetes. Follow me to receive practical coding examples.