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 Elasticsearch.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.208.97