I have verified that the latest Turbine from cvs will compile successfully
with the latest Log4j.
Thanks, Ceki!
- Sam Ruby
Ceki Gülcü <[EMAIL PROTECTED]> on 02/19/2001 08:56:40 AM
To: Sam Ruby/Raleigh/IBM@IBMUS, Jon Stevens <[EMAIL PROTECTED]>
cc:
Subject: Fwd: cvs commit: jakarta-log4j/org/apache/log4j/test confParsing
Sam, Jon,
FileAppender now maintains bw compatiblity but marks some methods as
deprecated. I intend to remove the deprecated APIs in log4j 1.2 (next
release is 1.1). Cheers, Ceki
>Delivered-To: [EMAIL PROTECTED]
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>List-Post: <mailto:[EMAIL PROTECTED]>
>List-Help: <mailto:[EMAIL PROTECTED]>
>List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
>List-Subscribe: <mailto:[EMAIL PROTECTED]>
>Reply-To: "LOG4J Developers Mailing List" <[EMAIL PROTECTED]>
>Delivered-To: mailing list [EMAIL PROTECTED]
>Date: 19 Feb 2001 13:44:29 -0000
>From: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: cvs commit: jakarta-log4j/org/apache/log4j/test confParsing
>
>ceki 01/02/19 05:44:28
>
> Modified: org/apache/log4j FileAppender.java WriterAppender.java
> org/apache/log4j/test confParsing
> Log:
> Restoring backward compatibility to FileAppender.java. Code stills needs
testing.
>
> Revision Changes Path
> 1.10 +53 -3 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.9
> retrieving revision 1.10
> diff -u -r1.9 -r1.10
> --- FileAppender.java 2001/02/13 20:22:10 1.9
> +++ FileAppender.java 2001/02/19 13:44:27 1.10
> @@ -68,6 +68,12 @@
> The name of the log file. */
> protected String fileName = null;
>
> + /**
> + Is the QuietWriter ours or was it created and passed by the user?
> +
> + @deprecated FileAppender will not support streams passed by the
> + user in the future. */
> + protected boolean qwIsOurs = false;
>
> /**
> The default constructor does not do anything.
> @@ -76,6 +82,38 @@
> FileAppender() {
> }
>
> +
> + /**
> + Instantiate a FileAppender and set the output destination to a
> + new {@link OutputStreamWriter} initialized with <code>os</code>
> + as its {@link OutputStream}.
> +
> + @deprecated <b>The functionality of constructor form has been
> + replaced by the {@link WriterAppender}. This constructor will be
> + removed in the <em>near</em> term.</b>
> +
> + */
> + public
> + FileAppender(Layout layout, OutputStream os) {
> + super(layout, new OutputStreamWriter(os));
> + }
> +
> + /**
> + Instantiate a FileAppender and set the output destination to
> + <code>writer</code>.
> +
> + <p>The <code>writer</code> must have been opened by the user.
> +
> + @deprecated <b>The functionality of constructor form has been
> + replaced by the {@link WriterAppender}. This constructor will be
> + removed in the <em>near</em> term.</b>
> + */
> + public
> + FileAppender(Layout layout, Writer writer) {
> + super(layout, writer);
> + }
> +
> +
> /**
> Instantiate a FileAppender and open the file designated by
> <code>filename</code>. The opened filename will become the ouput
> @@ -127,7 +165,7 @@
> */
> protected
> void closeFile() {
> - if(this.qw != null) {
> + if(this.qw != null && this.qwIsOurs) {
> try {
> this.qw.close();
> }
> @@ -170,6 +208,7 @@
> this.tp = new TracerPrintWriter(qw);
> this.fileName = fileName;
> this.fileAppend = append;
> + this.qwIsOurs = true;
> writeHeader();
> }
>
> @@ -197,8 +236,12 @@
>
> <p>The <b>File</b> option takes a string value which should be
> one of the strings "System.out" or "System.err" or the name of a
> - file.
> + file.
>
> + <font color="#FF0044"><b>Note that the "System.out" or
"System.err"
> + options are deprecated. Use {@link ConsoleAppender}
> + instead.</b></font>
> +
> <p>If the option is set to "System.out" or "System.err" the
> output will go to the corresponding stream. Otherwise, if the
> option is set to the name of a file, then the file will be opened
> @@ -222,7 +265,14 @@
> if(key.equalsIgnoreCase(FILE_OPTION)) {
> // Trim spaces from both ends. The users probably does not want
> // trailing spaces in file names.
> - fileName = value.trim();
> + String val = value.trim();
> + if(val.equalsIgnoreCase("System.out")) {
> + setWriter(new OutputStreamWriter(System.out));
> + } else if(val.equalsIgnoreCase("System.err")) {
> + setWriter(new OutputStreamWriter(System.err));
> + } else {
> + fileName = val;
> + }
> }
> else if (key.equalsIgnoreCase(APPEND_OPTION)) {
> fileAppend = OptionConverter.toBoolean(value, fileAppend);
>
>
>
> 1.2 +5 -0 jakarta-log4j/org/apache/log4j/WriterAppender.java
>
> Index: WriterAppender.java
> ===================================================================
> RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/WriterAppender.java,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- WriterAppender.java 2001/02/13 17:37:08 1.1
> +++ WriterAppender.java 2001/02/19 13:44:27 1.2
> @@ -143,6 +143,11 @@
> value <code>false</code> is returned. */
> protected
> boolean checkEntryConditions() {
> + if(this.closed) {
> + LogLog.warn("Not allowed to write to a closed appender.");
> + return false;
> + }
> +
> if(this.qw == null) {
> errorHandler.error("No output target set for appender named \""+
> name+"\".");
>
>
>
> 1.5 +2 -2 jakarta-log4j/org/apache/log4j/test/confParsing
>
> Index: confParsing
> ===================================================================
> RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/test/confParsing,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -r1.4 -r1.5
> --- confParsing 2001/02/13 17:37:33 1.4
> +++ confParsing 2001/02/19 13:44:28 1.5
> @@ -182,9 +182,9 @@
> D_FLAG=""
> echo "log4j.rootCategory= DEBUG , testAppender" > $LCF
> lecho "log4j.configDebug=false"
> - lecho "log4j.appender.testAppender=org.apache.log4j.ConsoleAppender"
> + lecho "log4j.appender.testAppender=org.apache.log4j.FileAppender"
> # Note the spaces
> - lecho "log4j.appender.testAppender.Target=System.out "
> + lecho "log4j.appender.testAppender.File=System.out "
> lecho
"log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout "
> lecho "log4j.appender.testAppender.layout.ConversionPattern=[%t] %p -
%m%n"
> echo -n " ConfigurationParsing test $TEST - "
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
----
Ceki Gülcü Web: http://qos.ch
av. de Rumine 5 email: [EMAIL PROTECTED] (preferred)
CH-1005 Lausanne [EMAIL PROTECTED]
Switzerland Tel: ++41 21 351 23 15
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]