Hi all 

We're experiencing issues with the Tomcat Connector log in some IIS production 
sites where the log file grows to a very large size (8GB on one site). 
This is almost entirely due to connection errors between the front end and back 
end produced when the back-end Tomcat is restarted after crashes or for 
maintenance. 
(we have some very high request volume sites - some with hundreds of concurrent 
requests -, so you can get thousands of these errors on each restart). 

I'm thinking about implementing log file rotation in the IIS connector as a 
solution to this, and wanted to canvas opinions on alternatives and 
implementation first. 

What I intend implementing is: 
* Daily log file rolling (not configurable) as a clone of the log_to_file 
function (check rotation, close and reopen log file, continue) 
* Very simple configuration for a daily rolling file appender - basically 
'on/off' and 'number of days to keep', possibly a single rotateable=bool/int 
parameter. 
* The log file name suffix will be appended/inserted to the name of the file 
specified in the connector config with a static pattern e.g. YYYY_MM_dd 
* The log method(s) will be guarded with a mutex to protect the rollover 
operation 
* I'll only be doing this for the ISAPI redirector at present (so won't need to 
refactor jk_mt.h to make the locking primitives available on prefork builds) 
* On rollover, the file will be closed and a new one opened. Older files will 
be pruned. 
* Rollover checking can be a simple mod operation on the timestamp (since I'm 
not intending to handle log formats) 

Questions I have: 
* Short of silencing the logging, is there an alternative to rolling the file? 
(perhaps rolling up of repeated connection errors?) 
* Are there any performance concerns about using a mutex on each log? (log4c 
uses this approach, so I presume it's not prohibitive) 
* Does anyone have any other input into config/behaviour? 

cheers 
tim 

Reply via email to