SpringBoot project deployment on Linux servers:
1. First SpringBoot project packaged into JAR package, by xFTP or other tool to upload the JAR package on Linux, then execute the following command to start the project:
java -jar xxx.jar &
The command to start the jar, once Xshell window closes, JAR stopped running.
If you want the project has been running in the background, start JAR with the following command:
nohup java -jar xxx.jar & >> consoleMsg.log 2>&1 &
Note: consoleMsg.log file must first create, execute the command:
touch consoleMsg.log
View Project Run Log:
1、tailf mywork.log | grep --line-buffered findUserList
Real-time tracking log, where as long as findUserList this method is run, it will print out logs for tracking specific log run.
--line-buffered is a line buffer, as long as the buffer is full this line will be printed, it can be used for real-time monitoring logs.
2, tailf -n 500 mywork.log print the last 500 lines of the log, and keep track log.
tail -n 2000 mywork.log | more tabs to view the last 2000 lines of the log.