Generating logs with Spring

Before getting started with setting up an ELK stack to manage our Spring logs, we must configure Spring to generate log files. This can easily be done with a Spring project's application.properties file. Let's configure our Place Reviewer backend to generate logs.

Open up the project's application.properties file and add the following line of code:

logging.file=application.log

This line of code configures Spring to generate and store server logs in an application.log file. This file will be generated and stored in the root directory of your project upon the next start of the project. What we have done is all that's necessary to configure server logs. Now, let's set up our log stack. We shall start by installing ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.