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/07/20 18:57:15 UTC
cvs commit: jakarta-log4j/src/java/org/apache/log4j ConsoleAppender.java DailyRollingFileAppender.java FileAppender.java RollingFileAppender.java WriterAppender.java RollingFileAppenderBeanInfo.java
ceki 01/07/20 09:57:15
Modified: src/java/org/apache/log4j ConsoleAppender.java
DailyRollingFileAppender.java FileAppender.java
RollingFileAppender.java WriterAppender.java
Removed: src/java/org/apache/log4j RollingFileAppenderBeanInfo.java
Log:
Removed getOptionStrings and setOption methods some appenders.
The RollingFileAppenderBeanInfo.java class is no longer needed.
Revision Changes Path
1.10 +10 -59 jakarta-log4j/src/java/org/apache/log4j/ConsoleAppender.java
Index: ConsoleAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/ConsoleAppender.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ConsoleAppender.java 2001/07/13 07:52:53 1.9
+++ ConsoleAppender.java 2001/07/20 16:57:15 1.10
@@ -23,13 +23,6 @@
public static final String SYSTEM_OUT = "System.out";
public static final String SYSTEM_ERR = "System.err";
- /**
- @deprecated Options are now handled using the JavaBeans paradigm.
- This constant is not longer needed and will be removed in the
- <em>near</em> term.
- */
- public static final String TARGET_OPTION = "Target";
-
protected String target = SYSTEM_OUT;
/**
@@ -55,11 +48,9 @@
}
/**
- Sets the value of the <b>Target</b> option.
-
- @param value String identifying a console; recognized values are
- "System.out" (default) and "System.err"
- */
+ Sets the value of the <b>Target</b> option. Recognized values are
+ "System.out" and "System.err". Any other value will be ignored.
+
public
void setTarget(String value) {
String v = value.trim();
@@ -73,7 +64,13 @@
}
}
- /** Returns the current value of the <b>Target</b> option. */
+ /**
+ Returns the current value of the <b>Target</b> property. The default
+ value of the option is "System.out".
+
+ See also {@link #setTarget}.
+
+ */
public
String getTarget() {
return target;
@@ -100,50 +97,4 @@
final
void closeWriter() {
}
-
-
- /**
- Returns the option names for this component, namely the string
- array {{@link #TARGET_OPTION} and the options of its super class
- {@link WriterAppender}.
-
- <b>See</b> Options of the super classes {@link WriterAppender} and
- {@link AppenderSkeleton}. In particular the <b>Threshold</b>
- option.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public
- String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {TARGET_OPTION});
- }
-
- /**
- Set ConsoleAppender specific options.
-
- The <b>Target</b> option is recognized on top of options
- for the super class {@link WriterAppender}.
-
- @deprecated Use the setter method for the option directly instead
- of the generic <code>setOption</code> method.
- */
- public
- void setOption(String key, String value) {
- if(value == null) return;
- super.setOption(key, value);
-
- if (key.equalsIgnoreCase(TARGET_OPTION)) {
- String v = value.trim();
- if(SYSTEM_OUT.equalsIgnoreCase(v)) {
- target = SYSTEM_OUT;
- } else {
- if(!SYSTEM_ERR.equalsIgnoreCase(v)) {
- targetWarn(value);
- }
- }
- }
- }
-
}
1.14 +1 -54 jakarta-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java
Index: DailyRollingFileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- DailyRollingFileAppender.java 2001/07/13 07:52:54 1.13
+++ DailyRollingFileAppender.java 2001/07/20 16:57:15 1.14
@@ -143,17 +143,6 @@
/**
- A string constant used in naming the option for setting the
- filename pattern. Current value of this string constant is
- <strong>DatePattern</strong>.
-
- @deprecated Options are now handled using the JavaBeans paradigm.
- This constant is not longer needed and will be removed in the
- <em>near</em> term.
- */
- static final public String DATE_PATTERN_OPTION = "DatePattern";
-
- /**
The date pattern. By default, the pattern is set to
"'.'yyyy-MM-dd" meaning daily rollover.
*/
@@ -212,48 +201,6 @@
return datePattern;
}
- /**
- Returns the option names for this component, namely {@link
- #DATE_PATTERN_OPTION} in
- addition to the options of {@link FileAppender#getOptionStrings
- FileAppender}.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
-
- */
- public
- String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {DATE_PATTERN_OPTION});
- }
-
- /**
- Set the options for the {@link DailyRollingFileAppender}
- instance.
-
- <p>The <b>DatePattern</b> takes a string in the same format as
- expected by {@link SimpleDateFormat}. This options determines the
- rollover schedule.
-
- <p>Be sure to refer to the options in the super classes {@link
- FileAppender}, {@link WriterAppender} and in particular the
- <b>Threshold</b> option in {@link AppenderSkeleton}.
-
- </ul>
-
- @deprecated Use the setter method for the option directly instead
- of the generic <code>setOption</code> method.
- */
- public
- void setOption(String key, String value) {
- if(value == null) return;
- super.setOption(key, value);
- if(key.equalsIgnoreCase(DATE_PATTERN_OPTION)) {
- datePattern = value;
- }
- }
-
public
void activateOptions() {
super.activateOptions();
@@ -457,4 +404,4 @@
}
return getTime();
}
-}
\ No newline at end of file
+}
1.23 +0 -67 jakarta-log4j/src/java/org/apache/log4j/FileAppender.java
Index: FileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/FileAppender.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- FileAppender.java 2001/07/13 07:52:57 1.22
+++ FileAppender.java 2001/07/20 16:57:15 1.23
@@ -35,32 +35,6 @@
@author Ceki Gülcü */
public class FileAppender extends WriterAppender {
- /**
- A string constant used in naming the option for setting the
- output file. Current value of this string constant is
- <b>File</b>.
-
- <p>Note that all option keys are case sensitive.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public static final String FILE_OPTION = "File";
-
-
- /**
- A string constant used in naming the option that determines whether
- the output file will be truncated or appended to. Current value
- of this string constant is <b>Append</b>.
-
- <p>Note that all option keys are case sensitive.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public static final String APPEND_OPTION = "Append";
-
-
/** Append to or truncate the file? The default value for this
variable is <code>true</code>, meaning that by default a
<code>FileAppender</code> will append to an existing file and
@@ -195,22 +169,6 @@
}
/**
- Returns the option names for this component, namely the string
- array {@link #FILE_OPTION}, {@link #APPEND_OPTION}} in addition
- to the options of its super class {@link WriterAppender}.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
-
- */
- public
- String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {FILE_OPTION, APPEND_OPTION});
- }
-
-
- /**
The <b>Append</b> option takes a boolean value. It is set to
<code>true</code> by default. If true, then <code>File</code>
will be opened in append mode by {@link #setFile setFile} (see
@@ -289,31 +247,6 @@
writeHeader();
}
-
- /**
- @deprecated Use the setter method for the option directly instead
- of the generic <code>setOption</code> method. */
- public
- void setOption(String key, String value) {
- if(value == null) return;
- super.setOption(key, value);
-
- if(key.equalsIgnoreCase(FILE_OPTION)) {
- // Trim spaces from both ends. The users probably does not want
- // trailing spaces in file names.
- 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);
- }
- }
/**
Sets the quiet writer being used.
1.14 +0 -65 jakarta-log4j/src/java/org/apache/log4j/RollingFileAppender.java
Index: RollingFileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/RollingFileAppender.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- RollingFileAppender.java 2001/07/13 07:53:11 1.13
+++ RollingFileAppender.java 2001/07/20 16:57:15 1.14
@@ -31,28 +31,6 @@
*/
public class RollingFileAppender extends FileAppender {
- /**
- A string constant used in naming the option for setting the
- maximum size of the log file. Current value of this string constant is
- <b>MaxFileSize</b>.
-
- @deprecated Options are now handled using the JavaBeans paradigm.
- This constant is not longer needed and will be removed in the
- <em>near</em> term.
-
- */
- static final public String MAX_FILE_SIZE_OPTION = "MaxFileSize";
-
- /**
- A string constant used in naming the option for setting the the
- number of backup files to retain. Current value of this string
- constant is <b>MaxBackupIndex</b>.
-
- @deprecated Options are now handled using the JavaBeans paradigm.
- This constant is not longer needed and will be removed in the
- <em>near</em> term.
- */
- static final public String MAX_BACKUP_INDEX_OPTION = "MaxBackupIndex";
/**
The default maximum file size is 10MB.
@@ -118,22 +96,6 @@
}
/**
- Retuns the option names for this component, namely {@link
- #MAX_FILE_SIZE_OPTION} and {@link #MAX_BACKUP_INDEX_OPTION} in
- addition to the options of {@link FileAppender#getOptionStrings}
-
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public
- String[] getOptionStrings() {
-
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {MAX_FILE_SIZE_OPTION, MAX_BACKUP_INDEX_OPTION});
- }
-
- /**
Implements the usual roll over behaviour.
<p>If <code>MaxBackupIndex</code> is positive, then files
@@ -202,22 +164,6 @@
}
}
- /**
-
- @deprecated Use the setter method for the option directly instead
- of the generic <code>setOption</code> method.
-
- */
- public
- void setOption(String key, String value) {
- super.setOption(key, value);
- if(key.equalsIgnoreCase(MAX_FILE_SIZE_OPTION)) {
- maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
- }
- else if(key.equalsIgnoreCase(MAX_BACKUP_INDEX_OPTION)) {
- maxBackupIndex = OptionConverter.toInt(value, maxBackupIndex);
- }
- }
/**
Set the maximum number of backup files to keep around.
@@ -233,17 +179,6 @@
this.maxBackupIndex = maxBackups;
}
- /**
- Set the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
-
- @deprecated Use {@link #setMaximumFileSize} instead.
- */
- public
- void setMaxFileSize(long maxFileSize) {
- this.maxFileSize = maxFileSize;
- }
-
/**
Set the maximum size that the output file is allowed to reach
before being rolled over to backup files.
1.16 +0 -40 jakarta-log4j/src/java/org/apache/log4j/WriterAppender.java
Index: WriterAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/WriterAppender.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- WriterAppender.java 2001/07/13 07:53:17 1.15
+++ WriterAppender.java 2001/07/20 16:57:15 1.16
@@ -30,19 +30,7 @@
@since 1.1 */
public class WriterAppender extends AppenderSkeleton {
- /**
- A string constant used in naming the option for immediate
- flushing of the output stream at the end of each append
- operation. Current value of this string constant is
- <b>ImmediateFlush</b>.
-
- <p>Note that all option keys are case sensitive.
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public static final String IMMEDIATE_FLUSH_OPTION = "ImmediateFlush";
-
/**
Immediate flush means that the underlying writer or output stream
will be flushed at the end of each append operation. Immediate
@@ -217,21 +205,7 @@
}
}
-
/**
- Retuns the option names for this component.
-
- @deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
- */
- public
- String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {IMMEDIATE_FLUSH_OPTION});
- }
-
-
- /**
Set the {@link ErrorHandler} for this FileAppender and also the
underlying {@link QuietWriter} if any. */
public
@@ -247,20 +221,6 @@
}
}
- /**
- @deprecated Use the setter method for the option directly instead
- of the generic <code>setOption</code> method.
- */
- public
- void setOption(String key, String value) {
- if(value == null) return;
- super.setOption(key, value);
-
- if (key.equalsIgnoreCase(IMMEDIATE_FLUSH_OPTION)) {
- immediateFlush = OptionConverter.toBoolean(value, immediateFlush);
- }
- }
-
/**
<p>Sets the Writer where the log output will go. The
specified Writer must be opened by the user and be
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-cvs-help@jakarta.apache.org