View | Details | Raw Unified | Return to bug 49180
Collapse All | Expand All

(-)java/org/apache/juli/FileHandler.java (-2 / +9 lines)
Lines 95-100 Link Here
95
95
96
96
97
    /**
97
    /**
98
     * Determines whether the logfile is rotatable
99
     */
100
    private boolean rotatable = true;
101
102
103
    /**
98
     * The PrintWriter to which we are currently logging, if any.
104
     * The PrintWriter to which we are currently logging, if any.
99
     */
105
     */
100
    private volatile PrintWriter writer = null;
106
    private volatile PrintWriter writer = null;
Lines 134-140 Link Here
134
140
135
        writerLock.readLock().lock();
141
        writerLock.readLock().lock();
136
        // If the date has changed, switch log files
142
        // If the date has changed, switch log files
137
        if (!date.equals(tsDate)) {
143
        if (rotatable && !date.equals(tsDate)) {
138
            // Update to writeLock before we switch
144
            // Update to writeLock before we switch
139
            writerLock.readLock().unlock();
145
            writerLock.readLock().unlock();
140
            writerLock.writeLock().lock();
146
            writerLock.writeLock().lock();
Lines 245-250 Link Here
245
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
251
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
246
        
252
        
247
        // Retrieve configuration of logging file name
253
        // Retrieve configuration of logging file name
254
        rotatable = Boolean.parseBoolean(getProperty(className + ".rotatable", "true"));
248
        if (directory == null)
255
        if (directory == null)
249
            directory = getProperty(className + ".directory", "logs");
256
            directory = getProperty(className + ".directory", "logs");
250
        if (prefix == null)
257
        if (prefix == null)
Lines 326-332 Link Here
326
        writerLock.writeLock().lock();
333
        writerLock.writeLock().lock();
327
        try {
334
        try {
328
            String pathname = dir.getAbsolutePath() + File.separator +
335
            String pathname = dir.getAbsolutePath() + File.separator +
329
                prefix + date + suffix;
336
                prefix + (rotatable ? date : "") + suffix;
330
            String encoding = getEncoding();
337
            String encoding = getEncoding();
331
            FileOutputStream fos = new FileOutputStream(pathname, true);
338
            FileOutputStream fos = new FileOutputStream(pathname, true);
332
            OutputStream os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos;
339
            OutputStream os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos;

Return to bug 49180