linux查看tomcat日志

通过关键字查询日志(两种方式)

1 : grep -nH "Excetion message" catalina.out
2:  cat -n  tomcat/logs/catalina.out | grep NullPointerException
catalina.out:239770:AtomException:className=XXXXXXXXXXXXXX=未查询到未制单的单据!
catalina.out:239772:	at com.xxxxxxx.CreateNoSystemError(xxxx.java:26)

记录行号行号

cat -n  tomcat/logs/catalina.out|tail -n +行号 |head -n +条数
例 : cat -n  tomcat/logs/catalina.out|tail -n +239770 |head -n +100

清空catalina.out日志

echo -n  " " > catalina.out

你可能感兴趣的:(工作记录)