You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2001/02/22 15:23:58 UTC
cvs commit: jakarta-log4j/org/apache/log4j DailyRollingFileAppender.java FileAppender.java
ceki 01/02/22 06:23:58
Modified: org/apache/log4j DailyRollingFileAppender.java
FileAppender.java
Log:
Fixed errouneous close of System.out or err in FileAppender.
Revision Changes Path
1.6 +1 -1 jakarta-log4j/org/apache/log4j/DailyRollingFileAppender.java
Index: DailyRollingFileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/DailyRollingFileAppender.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DailyRollingFileAppender.java 2001/02/22 14:13:51 1.5
+++ DailyRollingFileAppender.java 2001/02/22 14:23:53 1.6
@@ -319,7 +319,7 @@
rollover schedule.
<p>Be sure to refer to the options in the super classes {@link
- FileAppender}, {WriterAppender} and in particular the
+ FileAppender}, {@link WriterAppender} and in particular the
<b>Threshold</b> option in {@link AppenderSkeleton}.
</ul> */
1.15 +12 -12 jakarta-log4j/org/apache/log4j/FileAppender.java
Index: FileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/FileAppender.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- FileAppender.java 2001/02/22 13:53:14 1.14
+++ FileAppender.java 2001/02/22 14:23:54 1.15
@@ -215,16 +215,12 @@
<p>Sets and <i>opens</i> the file where the log output will
go. The specified file must be writable.
- <p>If there was already an opened stream opened through this
- method, then the previous stream is closed first. If the stream
- was opened by the user and passed to {@link #setWriter
- setWriter}, then the previous stream remains
- untouched. It is the users responsability to close it.
+ <p>If there was already an opened file, then the previous file
+ is closed first.
@param fileName The path to the log file.
@param append If true will append to fileName. Otherwise will
- truncate fileName.
- */
+ truncate fileName. */
public
synchronized
void setFile(String fileName, boolean append) throws IOException {
@@ -283,10 +279,9 @@
<p>Note: Actual opening of the file is made when {@link
#activateOptions} is called, not when the options are set.
- <b>See</b> Options of the super class {@link WriterAppender}.
- <b>See</b> Options of the super class {@link
- org.apache.log4j.AppenderSkeleton}, in particular the
- <b>Threshold</b> option.
+ <p>Make sure to refer to the options defined in the super classes
+ {@link WriterAppender} and in particular the <b>Threshold</b>
+ option in {@link AppenderSkeleton}.
@since 0.8.1 */
public
@@ -329,7 +324,12 @@
void reset() {
closeFile();
this.fileName = null;
- super.reset();
+ if(qwIsOurs) {
+ super.reset();
+ } else {
+ this.qw = null;
+ this.tp = null;
+ }
}
}