* is true.
*/
protected File currentLogFile = null;
- private class AccessDateStruct {
+ private static class AccessDateStruct {
private Date currentDate = new Date();
private String currentDateString = null;
private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
private SimpleDateFormat yearFormatter = new SimpleDateFormat("yyyy");
private SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm:ss");
public AccessDateStruct() {
- dayFormatter.setTimeZone(timezone);
- monthFormatter.setTimeZone(timezone);
- yearFormatter.setTimeZone(timezone);
- timeFormatter.setTimeZone(timezone);
+ TimeZone tz = TimeZone.getDefault();
+ dayFormatter.setTimeZone(tz);
+ monthFormatter.setTimeZone(tz);
+ yearFormatter.setTimeZone(tz);
+ timeFormatter.setTimeZone(tz);
}
}
* The system time when we last updated the Date that this valve
* uses for log lines.
*/
- private ThreadLocal<AccessDateStruct> currentDateStruct = new ThreadLocal<AccessDateStruct>() {
+ private static final ThreadLocal<AccessDateStruct> currentDateStruct =
+ new ThreadLocal<AccessDateStruct>() {
protected AccessDateStruct initialValue() {
return new AccessDateStruct();
}