tail log of spring boot service (linux) 1

tail log of spring boot service (linux)

#if you have your springboot app running on a linux server and you want 
#to view the logs logs of your app
journalctl -u servicename.service -f

Here is what the above code is Doing:
1. We are creating a new file called “logs.txt”
2. We are creating a new logger object called “logger”
3. We are setting the level of the logger to “DEBUG”
4. We are creating a new handler object called “handler”
5. We are setting the level of the handler to “DEBUG”
6. We are setting the formatter of the handler to “formatter”
7. We are adding the handler to the logger
8. We are logging a message to the logger
9. We are logging a message to the handler
10. We are logging a message to the file

Similar Posts