tomcat view the log command

tail -f real-time view the log file tail -f log file log
tail - view log files in real time after 100f hundred lines
tail -f -n 100 catalina.out linux after the view log 100 lines
tail -f ... / logs / catalina.out | grep "aaat" monitor real-time log "aaat" output the contents of
the search string
grep 'search string' filename
press ctrl + c to exit

Empty Enter tomcat log file> catalina.out
PS -elf | grep user_01 | wc -l number to view user_01 process
the query file content "roomCount__object" and the first 100 lines of content grep -n 100 "roomCount__object" logs / catalina.out
view tomcat log abnormal java.lang.IllegalStateException front row 20 and outputs the error log
cat catalina.out | grep "java.lang.IllegalStateException" -C 20

Check the server process

See all netstat -at number of processes
netstat -n | grep: 11215 | wc -l view port connections
netstat -n | awk '/ ^ tcp / {++ state [$ NF]} END {for (key in state) print key, "\ t", state [key]} ' statistics of the current number of processes
ps -eLF | grep user_01 | wc -l to view the number of processes user_01

Published 10 original articles · won praise 9 · views 451

Guess you like

Origin blog.csdn.net/weixin_43829047/article/details/103309417