首页 > 网站 > 帮助中心 > 正文

如何将日志打印到catalina.out中?

2024-07-09 22:41:30
字体:
来源:转载
供稿:网友
  很多小伙伴不知道怎么将日志打印到catalina.out中,其实方法是有的,只需要修改startup.bat就可以了。接下来就来看看如何操作吧~
  将call "%EXECUTABLE%" start %CMD_LINE_ARGS%修改为call "%EXECUTABLE%" run %CMD_LINE_ARGS%
  修改catalina.bat
  将最下面的
  %ACTION%?
  后面均添加上?>>%CATALINA_BASE%/logs/catalina.out
  修改后的样子:
  rem Execute Java with the applicable properties
  if not "%JPDA%" == "" goto doJpda
  if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
  %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%/logs/catalina.out
  goto end
  :doSecurity
  %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%/logs/catalina.out
  goto end
  :doJpda
  if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
  %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%/logs/catalina.out
  goto end
  :doSecurityJpda
  %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%/logs/catalina.out
  goto end
  总结:
  以上就是全部内容啦~更多资讯,敬请关注武林网之家
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表