Expand sync within rotatable block to fix a couple of issues:
- fileDateFormatter is a SimpleDateFormat which is not thread safe
- the rotationLastChecked needs to be volatile to ensure we don't execute the sync'd block multiple times
Although this is a sync on 'this' in log which gets called for every request:
- a similar sync occurs in getDate() for every request with minimal performance impact
- microbenchmarks suggest that a sync on 'this' has similar performance to using ThreadLocals
Based on kkolinko's patch for Tomcat 5.5.x
Note there remains an issue with writing to the log if the log files happens to be in the process of rotating
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@785983
13f79535-47bb-0310-9956-
ffa450edef68