One of the things I frequently do when TeamSite becomes unusable is to restart Tomcat, which generally has to be done quickly to keep the users from getting restless. Through the control panel this always seems to truncate the log files which may contain the debugging information I need to figure out why it had to be restarted. Here's a little batch file to restart Tomcat without losing the log files.
@echo off
net stop iwservletd
for /F "tokens=2,3,4 delims=/ " %%i in ( "%date%" ) do set DateStamp=%%k_%%i_%%j
for /F "tokens=1,2,3 delims=:. " %%i in ( "%time%" ) do set TimeStamp=%%i_%%j_%%k
for /f %%i in ( 'iwgethome' ) do set iwhome=%%i
set source=%iwhome%\local\logs\iwui
set target=%source%\%DateStamp%-%TimeStamp%.bak
mkdir %target%
echo Wait a few seconds to close file handles...
choice /n /t:Y,15
move %source%\*.log %target%
net start iwservletd
pause