startup.bat修改:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
改为:
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
catalina.bat修改:
4个'%ACTION%'的后面添加:
一、cmd查询日期格式:echo %date%
2、格式为:2017/11/03时,添加:
>> %CATALINA_HOME%\logs\catalina.%date:~0,10%.out
3、格式为:2017-11-03时,添加:
>> %CATALINA_HOME%\logs\catalina.%date:~0,4%-date:~5,2%-date:~8,2%.out.log
安装tail -f或者tail /?的执行文件
windows组件Windows Server 2003 Resource Kit Tools
或tail.exe
生成log文件******文件名为:2017-11-03.out.log
创建taillog.bat文件,内容为:
一、cmd查询日期格式:echo %date%
2、格式为:2017/11/03时,内容为:(文件名不能含有斜杠)
if not exist "%CATALINA_BASE%\logs\catalina.%date:~0,4%-%date:~5,2%-%date:~8,2%.out.log" ( //括号前要加空格,否则会报语法错误!!!
echo ""> %CATALINA_BASE%\logs\catalina.%date:~0,4%-%date:~5,2%-%date:~8,2%.out.log)
tail -f %CATALINA_BASE%\logs\catalina.%date:~0,4%-%date:~5,2%-%date:~8,2%.out.log
3、格式为:2017-11-03时,内容为:
if not exist "%CATALINA_BASE%\logs\catalina.%date:~0,10%.out.log" (
echo ""> %CATALINA_BASE%\logs\catalina.%date:~0,10%.out.log)
tail -f %CATALINA_BASE%\logs\catalina.%date:~0,4%-date:~5,2%-date:~8,2%.out.log
catalina.bat增加启动taillog.bat脚本:start taillog.bat
添加到
rem---Execute The Requested Command ---
if ""%1"" == ""debug"" goto use_jdk
echo Using JRE_HOME: "%JRE_HOME%"
这句脚本的下面: