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 an...@apache.org on 2001/03/19 13:38:22 UTC

cvs commit: jakarta-log4j/org/apache/log4j/xml XMLLayout.java

anders      01/03/19 04:38:22

  Modified:    org/apache/log4j AppenderSkeleton.java AsyncAppender.java
                        ConsoleAppender.java DailyRollingFileAppender.java
                        FileAppender.java HTMLLayout.java
                        PatternLayout.java RollingFileAppender.java
                        SimpleLayout.java TTCCLayout.java
                        WriterAppender.java
               org/apache/log4j/gui TextPaneAppender.java
               org/apache/log4j/helpers DateLayout.java
                        OnlyOnceErrorHandler.java
               org/apache/log4j/net JMSAppender.java SMTPAppender.java
                        SocketAppender.java SyslogAppender.java
               org/apache/log4j/nt NTEventLogAppender.java
               org/apache/log4j/spi OptionHandler.java
               org/apache/log4j/test PrintProperties.java UnitTestDRFA.java
                        confParsing getOptions
               org/apache/log4j/test/witness getOptions.1
               org/apache/log4j/varia DenyAllFilter.java
                        ExternallyRolledFileAppender.java
                        PriorityMatchFilter.java StringMatchFilter.java
               org/apache/log4j/xml XMLLayout.java
  Log:
  Updated OptionHandler based components to receive configuration
  information via JavaBeans style setters instead of through
  OptionHandler.setOption(name, value).  Likewise, regular Java getters
  are used in place of OptionHandler.getOption(name).
  
  Revision  Changes    Path
  1.9       +14 -66    jakarta-log4j/org/apache/log4j/AppenderSkeleton.java
  
  Index: AppenderSkeleton.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/AppenderSkeleton.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AppenderSkeleton.java	2001/02/22 13:53:14	1.8
  +++ AppenderSkeleton.java	2001/03/19 12:38:17	1.9
  @@ -54,25 +54,6 @@
      */
     protected boolean closed = false;
   
  -
  -  /**
  -     The variable <code>emittedWarning</code> lets us remember whether
  -     we already emitted a warning to <code>System.err.</code>  */
  -  //  protected boolean emittedWarning = false;
  -  
  -
  -  /**
  -     A string constant used in naming the option for setting the
  -     threshold for the appender. See also {@link #setThreshold
  -     setThreshold} method. Current value of this string constant is
  -     <b>Threshold</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String THRESHOLD_OPTION = "Threshold";
  -
  - 
     /**
        Derived appenders should override this method if option structure
        requires it.  */
  @@ -179,16 +160,6 @@
     }
   
     /**
  -     Returns the string array {{@link #THRESHOLD_OPTION}}.
  -
  -     <p>Configurable Appenders must override this method to return the
  -     additional options they accept.  */
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {THRESHOLD_OPTION};
  -  }
  -
  -  /**
        Check whether the message priority is below the appender's
        threshold. Ig there is no threshold set, then the return value is
        always <code>true</code>.
  @@ -268,56 +239,33 @@
     
     /**
        Set the name of this Appender.
  -     
      */
     public
     void setName(String name) {
       this.name = name;
     }
  -
  -
  -  /**
  -     All classes derived from {@link AppenderSkeleton} admit the
  -     <b>Threshold</b> option. The value of this option is a priority
  -     string, such as "DEBUG", "INFO" and so on.  All log events with
  -     lower priority than the threshold priority are ignored by the
  -     appender.  
  -
  -     <p>Configurable Appenders should override this method if they
  -     admit additional options.  */
  -  public
  -  void setOption(String key, String value) {
  -    if(key.equalsIgnoreCase(THRESHOLD_OPTION)) {
  -      threshold = Priority.toPriority(value);
  -    }
  -  }
     
     /**
  -     Returns the current value of the named option, or null if this
  -     is not a known option.
  -     
  -     <p>Configurable Appenders should override this method if they admit
  -     additional options.
  -
  -     The {@link AppenderSkeleton} returns the value of the
  -     {@link #THRESHOLD_OPTION} or null.
  -  */
  -  public
  -  String getOption(String key) {
  -    if(key.equalsIgnoreCase(THRESHOLD_OPTION)) {
  -      return threshold == null ? null : threshold.toString();
  -    } else {
  -      return null;
  -    }
  -  }
  -
  -  /**
        Set the threshold priority. All log events with lower priority
        than the threshold priority are ignored by the appender.
        
  +     <p>In configuration files this option is specified by setting the
  +     value of the <b>Threshold</b> option to a priority
  +     string, such as "DEBUG", "INFO" and so on.
  +     
        @since 0.8.3 */
     public
     void setThreshold(Priority threshold) {
       this.threshold = threshold;
  +  }
  +  
  +  /**
  +     Returns this appenders threshold priority.
  +     
  +     @since 1.1
  +   */
  +  public
  +  Priority getThreshold() {
  +    return threshold;
     }
   }
  
  
  
  1.11      +42 -68    jakarta-log4j/org/apache/log4j/AsyncAppender.java
  
  Index: AsyncAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/AsyncAppender.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AsyncAppender.java	2001/03/10 12:46:30	1.10
  +++ AsyncAppender.java	2001/03/19 12:38:17	1.11
  @@ -40,31 +40,8 @@
      @since version 0.9.1 */
   public class AsyncAppender extends AppenderSkeleton 
                                               implements AppenderAttachable {
  -
  -
  -  /**
  -     A string constant used in naming the option for setting the
  -     location information flag.  Current value of this string
  -     constant is <b>LocationInfo</b>.  
  -
  -     <p>Note that all option keys are case sensitive.
  -  */
  -  public static final String LOCATION_INFO_OPTION = "LocationInfo";
  -
  -
  -  /**
  -     A string constant used in naming the option for setting the size of the
  -     internal buffer where logging events are stored until they are written.
  -     Current value of this string constant is <b>BufferSize</b>.  
  -
  -     <p>Note that all option keys are case sensitive.
  -  */
  -  public static final String BUFFER_SIZE_OPTION = "BufferSize";
  -
  -
  -  /**
  -     The default buffer size is set to 128 events.
  -   */
  +  
  +  /** The default buffer size is set to 128 events. */
     public static final int DEFAULT_BUFFER_SIZE = 128;
   
     //static Category cat = Category.getInstance(AsyncAppender.class.getName());
  @@ -146,17 +123,6 @@
     Appender getAppender(String name) {
       return aai.getAppender(name);
     }
  -
  - /**
  -     Returns the option names for this component in addition in
  -     addition to the options of its super class {@link
  -     AppenderSkeleton}.  */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -          new String[] {LOCATION_INFO_OPTION});
  -  }
  -
     
     /**
        The <code>AsyncAppender</code> does not require a layout. Hence,
  @@ -183,16 +149,33 @@
     void removeAppender(String name) {
       aai.removeAppender(name);
     }
  +
  +  /**
  +     The <b>LocationInfo</b> option takes a boolean value. By
  +     default, it is set to false which means there will be no effort
  +     to extract the location information related to the event. As a
  +     result, the event that will be ultimately logged will likely to
  +     contain the wrong location information (if present in the log
  +     format).
   
  - 
  - /**
  -     Set AsyncAppender specific options:
  -
  -     <p>On top of the options of the super class {@link
  -     AppenderSkeleton}, the only recognized options are
  -     <b>BufferSize</b> and <b>LocationInfo</b>.
  -     
  -     <p> The <b>BufferSize</b> option takes a non-negative integer
  +     <p>Location information extraction is comparatively very slow and
  +     should be avoided unless performance is not a concern.
  +   */
  +  public
  +  void setLocationInfo(boolean flag) {
  +    locationInfo = flag;
  +  }
  +  
  +  /**
  +     Returns the current value of the <b>LocationInfo</b> option.
  +   */
  +  public
  +  boolean getLocationInfo() {
  +    return locationInfo;
  +  }
  +  
  +  /**
  +     The <b>BufferSize</b> option takes a non-negative integer
        value.  This integer value determines the maximum size of the
        bounded buffer. Increasing the size of the buffer is always
        safe. However, if an existing buffer holds unwritten elements,
  @@ -202,32 +185,22 @@
        {@link #DEFAULT_BUFFER_SIZE default buffer size} because
        configurators guarantee that an appender cannot be used before
        being completely configured. 
  -
  -     <p>The <b>LocationInfo</b> option takes a boolean value. By
  -     default, it is set to false which means there will be no effort
  -     to extract the location information related to the event. As a
  -     result, the event that will be ultimately logged will likely to
  -     contain the wrong location information (if present in the log
  -     format).
  -
  -     <p>Location information extraction is comparatively very slow and
  -     should be avoided unless performance is not a concern.
  -
  - */
  +   */
     public
  -  void setOption(String option, String value) {
  -    if(value == null) return;
  -    super.setOption(option, value);
  -
  -    if (option.equals(LOCATION_INFO_OPTION))
  -      locationInfo = OptionConverter.toBoolean(value, locationInfo);
  -    else if (option.equals(BUFFER_SIZE_OPTION)) {
  -      int newSize = OptionConverter.toInt(value, DEFAULT_BUFFER_SIZE);
  -      bf.resize(newSize);
  -    }
  +  void setBufferSize(int size) {
  +    bf.resize(size);
     }
  -
  +  
  +  /**
  +     Returns the current value of the <b>BufferSize</b> option.
  +   */
     public
  +  int getBufferSize() {
  +    return bf.getMaxSize();
  +  }
  +  
  +  /*
  +  public
     String getOption(String option) {
       if (option.equals(LOCATION_INFO_OPTION)) {
         return locationInfo ? "true" : "false";
  @@ -237,6 +210,7 @@
         return super.getOption(option);
       }
     }
  +  */
   }
   // ------------------------------------------------------------------------------
   // ------------------------------------------------------------------------------
  
  
  
  1.4       +35 -54    jakarta-log4j/org/apache/log4j/ConsoleAppender.java
  
  Index: ConsoleAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/ConsoleAppender.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConsoleAppender.java	2001/03/10 12:46:22	1.3
  +++ ConsoleAppender.java	2001/03/19 12:38:18	1.4
  @@ -22,11 +22,8 @@
     public static final String SYSTEM_OUT = "System.out";
     public static final String SYSTEM_ERR = "System.err";
   
  -  public static final String TARGET_OPTION = "Target";
  +  protected String target = SYSTEM_ERR;
   
  -
  -  protected String target = "SYSTEM_ERR";
  -
     /**
        The default constructor does nothing.
      */
  @@ -39,16 +36,45 @@
   
     public ConsoleAppender(Layout layout, String target) {
       this.layout = layout;
  -    if(SYSTEM_OUT.equals(target)) {
  +    
  +    if (SYSTEM_OUT.equals(target)) {
         setWriter(new OutputStreamWriter(System.out));	
  -    } else {
  -      if(!SYSTEM_ERR.equalsIgnoreCase(target)) {
  -	targetWarn(target);
  -      }
  +    } else if (SYSTEM_ERR.equalsIgnoreCase(target)) {
         setWriter(new OutputStreamWriter(System.err));
  +    } else {
  +      targetWarn(target);
       }
     }
   
  +  /**
  +     Sets the value of the <b>Target</b> option.
  +     
  +     @param value String identifying a console; recognized values are
  +                  "System.err" (default) and "System.out"
  +   */
  +  public
  +  void setTarget(String value) {
  +    String v = value.trim();
  +    
  +    if (SYSTEM_OUT.equalsIgnoreCase(v)) {
  +      target = SYSTEM_OUT;
  +    } else if (SYSTEM_ERR.equalsIgnoreCase(v)) {
  +      target = SYSTEM_ERR;
  +    } else {
  +      targetWarn(value);
  +    }  
  +  }
  +  
  +  /** Returns the current value of the <b>Target</b> option. */
  +  public
  +  String getTarget() {
  +    return target;
  +  }
  +  
  +  void targetWarn(String val) {
  +    LogLog.warn("["+val+"] should be one of System.out or System.err.");
  +    LogLog.warn("Reverting to System.err.");
  +  }
    
     public
     void activateOptions() {
  @@ -65,50 +91,5 @@
     protected
     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. 
  -  */
  -  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}.
  -     
  -  */
  -  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);
  -	}  
  -      }
  -    }
  -  }
  -  
  -  
  -  void targetWarn(String val) {
  -    LogLog.warn("["+val+"] should be one of System.out or System.err.");
  -    LogLog.warn("Reverting to System.err.");
     }
   }
  
  
  
  1.9       +17 -38    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DailyRollingFileAppender.java	2001/03/04 23:57:20	1.8
  +++ DailyRollingFileAppender.java	2001/03/19 12:38:18	1.9
  @@ -147,7 +147,7 @@
        filename pattern. Current value of this string constant is
        <strong>DatePattern</strong>.
      */
  -  static final public String DATE_PATTERN_OPTION = "DatePattern";
  +  //static final public String DATE_PATTERN_OPTION = "DatePattern";
     
     /**
        The date pattern. By default, the pattern is set to
  @@ -191,6 +191,21 @@
       activateOptions();
     }
   
  +  /**
  +     The <b>DatePattern</b> takes a string in the same format as
  +     expected by {@link SimpleDateFormat}. This options determines the
  +     rollover schedule.
  +   */
  +  public
  +  void setDatePattern(String pattern) {
  +    datePattern = pattern;
  +  }
  +  
  +  /** Returns the value of the <b>DatePattern</b> option. */
  +  public
  +  String getDatePattern() {
  +    return datePattern;
  +  }
   
     public
     void activateOptions() {
  @@ -258,28 +273,14 @@
       return TOP_OF_TROUBLE; // Deliberately head for trouble...
     }
   
  -
     /**
  -     Retuns the option names for this component, namely {@link
  -     #DATE_PATTERN_OPTION} in
  -     addition to the options of {@link FileAppender#getOptionStrings
  -     FileAppender}.
  -  */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -		 new String[] {DATE_PATTERN_OPTION});
  -  }
  -
  -  /**
        Rollover the current file to a new file.
     */  
     void rollOver() throws IOException {
   
       /* Compute filename, but only if datePattern is specified */
       if (datePattern == null) {
  -      errorHandler.error("Missing "+DATE_PATTERN_OPTION+
  -			 " option in rollOver().");
  +      errorHandler.error("Missing DatePattern option in rollOver().");
         return;
       }
   
  @@ -310,28 +311,6 @@
       scheduledFilename = datedFilename;    
     }
   
  -  /**
  -     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> */
  -  public
  -  void setOption(String key, String value) {
  -    if(value == null) return;
  -    super.setOption(key, value);    
  -    if(key.equalsIgnoreCase(DATE_PATTERN_OPTION)) {
  -      datePattern = value;
  -    }
  -  }
  -  
     /**
        This method differentiates DailyRollingFileAppender from its
        super class.
  
  
  
  1.17      +58 -121   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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FileAppender.java	2001/02/28 20:34:36	1.16
  +++ FileAppender.java	2001/03/19 12:38:18	1.17
  @@ -35,28 +35,6 @@
      @author Ceki G&uuml;lc&uuml; */
   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.
  -     
  -  */
  -  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.
  -     
  -  */
  -  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
  @@ -145,6 +123,64 @@
     }
   
     /**
  +     The <b>File</b> option takes a string value which should be
  +     the name of the file to append to. Special values "System.out" or
  +     "System.err" are interpreted as the standard out and standard
  +     error streams.
  +
  +     <p><font color="#DD0044"><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
  +     and output will go there.
  +     
  +     <p>Note: Actual opening of the file is made when {@link
  +     #activateOptions} is called, not when the options are set.
  +   */
  +  public void setFile(String file) {
  +    // Trim spaces from both ends. The users probably does not want 
  +    // trailing spaces in file names.
  +    String val = file.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;
  +    }
  +  }
  +  
  +  /** Returns the value of the <b>File</b> option. */
  +  public
  +  String getFile() {
  +    return fileName;
  +  }
  +  
  +  /**
  +     <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
  +     above). Otherwise, {@link #setFile setFile} will open
  +     <code>File</code> in truncate mode.
  +
  +     <p>Note: Actual opening of the file is made when {@link
  +     #activateOptions} is called, not when the options are set.
  +   */
  +  public
  +  void setAppend(boolean flag) {
  +    fileAppend = flag;
  +  }
  +  
  +  /** Returns the value of the <b>Append</b> option. */
  +  public
  +  boolean getAppend() {
  +    return fileAppend;
  +  }
  +
  +  /**
        If the value of {@link #FILE_OPTION} is not <code>null</code>, then {@link
        #setFile} is called with the values of {@link #FILE_OPTION} and
        {@link #APPEND_OPTION}.
  @@ -186,32 +222,6 @@
     }
   
     /**
  -     Return an option by name.     
  -   */
  -  public
  -  String getOption(String key) {
  -    if (key.equalsIgnoreCase(FILE_OPTION)) {
  -      return fileName;
  -    } else if (key.equalsIgnoreCase(APPEND_OPTION)) {
  -      return fileAppend ? "true" : "false";
  -    } else {
  -      return super.getOption(key);
  -    }
  -  }
  -
  - 
  -  /**
  -     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}.  */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -          new String[] {FILE_OPTION, APPEND_OPTION});
  -  }
  -
  -
  -  /**
       <p>Sets and <i>opens</i> the file where the log output will
       go. The specified file must be writable. 
   
  @@ -231,79 +241,6 @@
       this.fileAppend = append;
       this.qwIsOurs = true;
       writeHeader();
  -  }
  -
  -  /**
  -    <p>Sets and <i>opens</i> the file where the log output will
  -    go. The specified file must be writable.
  -
  -    <p>The open mode (append/truncate) will depend on the value of
  -    FileAppend option. If undefined, append mode is used.
  -
  -    @param fileName The name of the log file.
  -  */
  -  public
  -  void setFile(String fileName) throws IOException {    
  -    this.setFile(fileName, fileAppend);
  -  }
  -  
  -  /**
  -     Set FileAppender specific options.
  -          
  -     The recognized options are <b>File</b> and <b>Append</b>,
  -     i.e. the values of the string constants. The options of the super
  -     class {@link WriterAppender} are also recognized. See in
  -     particular the <b>Threshold</b> option of {@link
  -     AppenderSkeleton}.
  -
  -     <p>The <b>File</b> option takes a string value which should be
  -     the name of the file to append to. Special values "System.out" or
  -     "System.err" are interpreted as the standard out and standard
  -     error streams.
  -
  -     <font color="#DD0044"><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
  -     and output will go there.
  -     
  -     <p>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
  -     above). Otherwise, {@link #setFile setFile} will open
  -     <code>File</code> in truncate mode.
  -
  -     <p>Note: Actual opening of the file is made when {@link
  -     #activateOptions} is called, not when the options are set.
  -     
  -     <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
  -  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);
  -    }
     }
   
     /**
  
  
  
  1.13      +32 -64    jakarta-log4j/org/apache/log4j/HTMLLayout.java
  
  Index: HTMLLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/HTMLLayout.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HTMLLayout.java	2001/02/14 19:51:32	1.12
  +++ HTMLLayout.java	2001/03/19 12:38:18	1.13
  @@ -27,17 +27,40 @@
     // output buffer appended to when format() is invoked
     private StringBuffer sbuf = new StringBuffer(BUF_SIZE);
   
  +  // Print no location info by default
  +  boolean locationInfo = false;
  +
     /**
  -     A string constant used in naming the option for setting the the
  -     location information flag.  Current value of this string
  -     constant is <b>LocationInfo</b>.  
  +     The <b>LocationInfo</b> option takes a boolean value. By
  +     default, it is set to false which means there will be no location
  +     information output by this layout. If the the option is set to
  +     true, then the file name and line number of the statement
  +     at the origin of the log statement will be output. 
   
  -     <p>Note that all option keys are case sensitive.
  +     <p>If you are embedding this layout within an {@link
  +     org.apache.log4j.net.SMTPAppender} then make sure to set the
  +     <b>LocationInfo</b> option of that appender as well.
  +   */
  +  public
  +  void setLocationInfo(boolean flag) {
  +    locationInfo = flag;
  +  }
  +  
  +  /**
  +     Returns the current value of the <b>LocationInfo</b> option.
  +   */
  +  public
  +  boolean getLocationInfo() {
  +    return locationInfo;
  +  }
  +  
  + /**
  +     Returns the content type output by this layout, i.e "text/html".
     */
  -  public static final String LOCATION_INFO_OPTION = "LocationInfo";
  -
  -  // Print no location info by default
  -  boolean locationInfo = false;
  +  public
  +  String getContentType() {
  +    return "text/html";
  +  }
   
     /**
        No options to activate.
  @@ -112,17 +135,6 @@
       return sbuf.toString();
     }
   
  -
  - /**
  -     Returns the content type output by this layout, i.e "text/html".
  -  */
  -  public
  -  String getContentType() {
  -    return "text/html";
  -  }
  -
  -  
  -
     /**
        Returns appropriate HTML headers.
     */
  @@ -148,15 +160,7 @@
       return "</table></body></html>";
     }
     
  -
  -  /**
  -     Returns a String consisting of one element {@link
  -     #LOCATION_INFO_OPTION}.  */
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {LOCATION_INFO_OPTION};
  -  }
  -
  +  
     String getThrowableAsHTML(Throwable throwable) {
       if(throwable == null) 
         return null;
  @@ -175,42 +179,6 @@
     public
     boolean ignoresThrowable() {
       return false;
  -  }
  -
  -  /**
  -     Set HTMLLayout specific options.
  -
  -     <p>The <b>LocationInfo</b> option takes a boolean value. By
  -     default, it is set to false which means there will be no location
  -     information output by this layout. If the the option is set to
  -     true, then the file name and line number of the statement
  -     at the origin of the log statement will be output. 
  -
  -     <p>If you are embedding this layout within an {@link
  -     org.apache.log4j.net.SMTPAppender} then make sure to set the
  -     <b>LocationInfo</b> option of that appender as well.
  -     
  -   */
  -  public
  -  void setOption(String key, String value) {
  -    if(value == null) return;
  -
  -    if (key.equals(LOCATION_INFO_OPTION)) {
  -      locationInfo = OptionConverter.toBoolean(value, locationInfo);
  -    }
  -  }
  -  
  -  /**
  -     Returns the current value of the specified option, or null if
  -     it is unknown.
  -  */
  -  public
  -  String getOption(String key) {
  -    if (key.equals(LOCATION_INFO_OPTION)) {
  -      return locationInfo ? "true" : "false";
  -    } else {
  -      return null;
  -    }
     }
   
     /**
  
  
  
  1.7       +30 -92    jakarta-log4j/org/apache/log4j/PatternLayout.java
  
  Index: PatternLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/PatternLayout.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PatternLayout.java	2001/02/12 17:00:14	1.6
  +++ PatternLayout.java	2001/03/19 12:38:18	1.7
  @@ -378,28 +378,11 @@
      @since 0.8.2 */
   public class PatternLayout extends Layout {
   
  -   /**
  -     A string constant used in naming the option for setting the
  -     layout pattern. Current value of this string constant is
  -     <b>ConversionPattern</b>.
  -
  -     <p>Note that the search for all option keys is case sensitive.
  -     
  -  */
  -  final static public String CONVERSION_PATTERN_OPTION = "ConversionPattern";
  -
     /** Default pattern string for log output. Currently set to the
         string <b>"%m%n"</b> which just prints the application supplied
         message. */
     public final static String DEFAULT_CONVERSION_PATTERN ="%m%n";
   
  -  /*
  -     A string constant used in naming the option for setting the time
  -     zone for date output. Current value of this string constant is
  -     <b>TimeZone</b>.
  -  */
  -  //final static public String TIMEZONE_OPTION = "TimeZone";  
  -  
     /** A conversion pattern equivalent to the TTCCCLayout.
         Current value is <b>%r [%t] %p %c %x - %m%n</b>. */  
     public final static String TTCC_CONVERSION_PATTERN
  @@ -436,8 +419,27 @@
       head = createPatternParser((pattern == null) ? DEFAULT_CONVERSION_PATTERN : 
   			     pattern).parse();
     }
  -
  +  
     /**
  +     Set the <b>ConversionPattern</b> option. This is the string which
  +     controls formatting and consists of a mix of literal content and
  +     conversion specifiers.
  +   */
  +  public
  +  void setConversionPattern(String conversionPattern) {
  +    pattern = conversionPattern;
  +    head = createPatternParser(conversionPattern).parse();
  +  }
  +  
  +  /**
  +     Returns the value of the <b>ConversionPattern</b> option.
  +   */
  +  public
  +  String getConversionPattern() {
  +    return pattern;
  +  }
  +  
  +  /**
        Does not do anything as options become effective immediately. See
        {@link #setOption} method. */
     public
  @@ -445,6 +447,16 @@
       // nothing to do.
     }
     
  + /**
  +     The PatternLayout does not handle the throwable contained within
  +     {@link LoggingEvent LoggingEvents}. Thus, it returns
  +     <code>true</code>.
  +
  +     @since 0.8.4 */
  +  public
  +  boolean ignoresThrowable() {
  +    return true;
  +  }
   
     /**
       Returns PatternParser used to parse the conversion string. Subclasses
  @@ -476,79 +488,5 @@
         c = c.next;
       }
       return sbuf.toString();
  -  }
  -  
  -
  -  /**
  -     Returns the the array of option strings that {@link
  -     PatternLayout} recognizes. The only recognized option string is
  -     the value of {@link #CONVERSION_PATTERN_OPTION}.
  -  */
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {CONVERSION_PATTERN_OPTION};
  -  }	
  -
  - /**
  -     The PatternLayout does not handle the throwable contained within
  -     {@link LoggingEvent LoggingEvents}. Thus, it returns
  -     <code>true</code>.
  -
  -     @since 0.8.4 */
  -  public
  -  boolean ignoresThrowable() {
  -    return true;
  -  }
  -  
  -  /**
  -     Set the conversion pattern.
  -   */
  -  public
  -  void setConversionPattern(String conversionPattern) {
  -    setOption(CONVERSION_PATTERN_OPTION, conversionPattern);
  -  }
  -
  -  /**
  -     The PatternLayout specific options are:
  -
  -     <p>
  -     <dl>
  -     <dt><b>ConversionPattern</b>
  -
  -     <p><dd>The value determines the conversion pattern used.
  -     
  -     </dl>
  -   */
  -  public
  -  void setOption(String option, String value) {
  -    if(value == null)
  -      return;
  -    if(option.equalsIgnoreCase(CONVERSION_PATTERN_OPTION)) {
  -      pattern = value;
  -      head = createPatternParser(value).parse();
  -    }
  -    //else if(option.equals(TIMEZONE_OPTION)) {
  -    //try {
  -    //timezone = OptionConverter.substituteVars(value);
  -    //}
  -    //catch(IllegalArgumentException e) {
  -    //LogLog.error("Could not substitute variables." , e);
  -    //}
  -    //}
  -  }
  -  
  -  /**
  -      Returns the current value of the named option, or null if the
  -      option name is unkown.
  -      
  -      The PatternLayout recognizes only the "ConversionPattern" option.
  -  */
  -  public
  -  String getOption(String option) {
  -    if (option.equalsIgnoreCase(CONVERSION_PATTERN_OPTION)) {
  -      return pattern;
  -    } else {
  -      return null;
  -    }
     }
   }
  
  
  
  1.6       +48 -78    jakarta-log4j/org/apache/log4j/RollingFileAppender.java
  
  Index: RollingFileAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/RollingFileAppender.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RollingFileAppender.java	2001/02/28 20:39:43	1.5
  +++ RollingFileAppender.java	2001/03/19 12:38:18	1.6
  @@ -30,20 +30,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>.
  -   */
  -  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>.  */
  -  static final public String MAX_BACKUP_INDEX_OPTION = "MaxBackupIndex";  
  -
     /**
        The default maximum file size is 10MB. 
     */
  @@ -88,17 +74,51 @@
       super(layout, filename);
     }
     
  +  /**
  +     Set the maximum number of backup files to keep around.
  +     
  +     <p>The <b>MaxBackupIndex</b> option determines how many backup
  +     files are kept before the oldest is erased. This option takes
  +     a positive integer value. If set to zero, then there will be no
  +     backup files and the log file will be truncated when it reaches
  +     <code>MaxFileSize</code>.
  +   */
  +  public
  +  void setMaxBackupIndex(int maxBackups) {
  +    this.maxBackupIndex = maxBackups;    
  +  }
  +  
     /**
  -     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
  -     FileAppender}.  */
  +     Returns the value of the <b>MaxBackupIndex</b> option.
  +   */
     public
  -  String[] getOptionStrings() {
  +  int getMaxBackupIndex() {
  +    return maxBackupIndex;
  +  }
   
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -		 new String[] {MAX_FILE_SIZE_OPTION, MAX_BACKUP_INDEX_OPTION});
  +  /**
  +     Set the maximum size that the output file is allowed to reach
  +     before being rolled over to backup files.
  +     
  +     <p>In configuration files, the <b>MaxFileSize</b> option takes an
  +     long integer in the range 0 - 2^63. You can specify the value
  +     with the suffixes "KB", "MB" or "GB" so that the integer is
  +     interpreted being expressed respectively in kilobytes, megabytes
  +     or gigabytes. For example, the value "10KB" will be interpreted
  +     as 10240.
  +   */
  +  public
  +  void setMaxFileSize(String value) {
  +    maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
     }
  +  
  +  /**
  +     Returns the value of the <b>MaxFileSize</b> option.
  +   */
  +  public
  +  long getMaxFileSize() {
  +    return maxFileSize;
  +  }
   
     public
     synchronized
  @@ -124,12 +144,14 @@
        <code>File</code> is truncated with no backup files created.
        
      */
  -
     public // synchronization not necessary since doAppend is alreasy synched
     void rollOver() {
       File target;    
       File file;
   
  +    LogLog.debug("rolling over count=" + ((CountingQuietWriter) qw).getCount());
  +    LogLog.debug("maxBackupIndex="+maxBackupIndex);
  +    
       // If maxBackups <= 0, then there is no file renaming to be done.
       if(maxBackupIndex > 0) {
         // Delete the oldest file, to keep Windows happy.
  @@ -142,6 +164,7 @@
   	file = new File(fileName + "." + i);
   	if (file.exists()) {
   	  target = new File(fileName + '.' + (i + 1));
  +	  LogLog.debug("Renaming file " + file + " to " + target);
   	  file.renameTo(target);
   	}
         }
  @@ -152,6 +175,7 @@
         this.closeFile(); // keep windows happy. 
   
         file = new File(fileName);
  +      LogLog.debug("Renaming file " + file + " to " + target);
         file.renameTo(target);
       }
       
  @@ -165,64 +189,11 @@
       }
     }
   
  -  /**
  -     Set the maximum number of backup files to keep around.
  -     
  -   */
  -  public
  -  void setMaxBackupIndex(int maxBackups) {
  -    this.maxBackupIndex = maxBackups;    
  -  } 
  -
  -  /**
  -     Set the maximum size that the output file is allowed to reach
  -     before being rolled over.     
  -   */
  -  public
  -  void setMaxFileSize(long maxFileSize) {
  -    this.maxFileSize = maxFileSize;    
  -  }
  -
  -   /**
  -     Set RollingFileAppender specific options.
  -
  -     In addition to {@link FileAppender#setOption FileAppender
  -     options} RollingFileAppender recognizes the options
  -     <b>MaxFileSize</b> and <b>MaxBackupIndex</b>.
  -
  -     
  -     <p>The <b>MaxFileSize</b> determines the size of log file
  -     before it is rolled over to backup files. This option takes an
  -     long integer in the range 0 - 2^63. You can specify the value
  -     with the suffixes "KB", "MB" or "GB" so that the integer is
  -     interpreted being expressed respectively in kilobytes, megabytes
  -     or gigabytes. For example, the value "10KB" will be interpreted
  -     as 10240.
  -     
  -     <p>The <b>MaxBackupIndex</b> option determines how many backup
  -     files are kept before the oldest is erased. This option takes
  -     a positive integer value. If set to zero, then there will be no
  -     backup files and the log file will be truncated when it reaches
  -     <code>MaxFileSize</code>.
  -
  -   */
  -  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);
  -    }
  -  }
  -  
     protected
     void setQWForFiles(Writer writer) {
        this.qw = new CountingQuietWriter(writer, errorHandler);
     }
   
  -
     /**
        This method differentiates RollingFileAppender from its super
        class.  
  @@ -235,6 +206,5 @@
       if((fileName != null) &&
                        ((CountingQuietWriter) qw).getCount() >= maxFileSize) 
         this.rollOver();
  -   } 
  -
  -} 
  +   }
  +}
  
  
  
  1.5       +0 -14     jakarta-log4j/org/apache/log4j/SimpleLayout.java
  
  Index: SimpleLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/SimpleLayout.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleLayout.java	2001/01/26 13:27:45	1.4
  +++ SimpleLayout.java	2001/03/19 12:38:18	1.5
  @@ -52,11 +52,6 @@
       return sbuf.toString();
     }
   
  -  public
  -  String[] getOptionStrings() {
  -    return new String[0];
  -  }
  -
   /**
        The SimpleLayout does not handle the throwable contained within
        {@link LoggingEvent LoggingEvents}. Thus, it returns
  @@ -66,14 +61,5 @@
     public
     boolean ignoresThrowable() {
       return true;
  -  }  
  -
  -  public
  -  void setOption(String option, String value) {
  -  }
  -  
  -  public
  -  String getOption(String option) {
  -    return null;
     }
   }
  
  
  
  1.7       +55 -87    jakarta-log4j/org/apache/log4j/TTCCLayout.java
  
  Index: TTCCLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/TTCCLayout.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TTCCLayout.java	2001/01/26 13:27:45	1.6
  +++ TTCCLayout.java	2001/03/19 12:38:18	1.7
  @@ -69,9 +69,9 @@
   */
   public class TTCCLayout extends DateLayout {
   
  -  final static public String THREAD_PRINTING_OPTION = "ThreadPrinting";
  -  final static public String CATEGORY_PREFIXING_OPTION = "CategoryPrefixing";
  -  final static public String CONTEXT_PRINTING_OPTION  = "ContextPrinting";  
  +  //final static public String THREAD_PRINTING_OPTION = "ThreadPrinting";
  +  //final static public String CATEGORY_PREFIXING_OPTION = "CategoryPrefixing";
  +  //final static public String CONTEXT_PRINTING_OPTION  = "ContextPrinting";  
   
       		
     // Internal representation of options
  @@ -106,8 +106,58 @@
     public TTCCLayout(String dateFormatType) {
       this.setDateFormat(dateFormatType);
     }
  -
     
  +  /**
  +     The <b>ThreadPrinting</b> option specifies whether the name of the
  +     current thread is part of log output or not. This is true by default.
  +   */
  +  public
  +  void setThreadPrinting(boolean threadPrinting) {
  +    this.threadPrinting = threadPrinting;
  +  }
  +  
  +  /**
  +     Returns value of the <b>ThreadPrinting</b> option.
  +   */
  +  public
  +  boolean getThreadPrinting() {
  +    return threadPrinting;
  +  }
  +  
  +  /**
  +     The <b>CategoryPrefixing</b> option specifies whether {@link Category}
  +     name is part of log output or not. This is true by default.
  +   */
  +  public
  +  void setCategoryPrefixing(boolean categoryPrefixing) {
  +    this.categoryPrefixing = categoryPrefixing;
  +  }
  +  
  +  /**
  +     Returns value of the <b>CategoryPrefixing</b> option.
  +   */
  +  public
  +  boolean getCategoryPrefixing() {
  +    return categoryPrefixing;
  +  }
  +  
  +  /**
  +     The <b>ContextPrinting</b> option specifies log output will include
  +     the nested context information belonging to the current thread.
  +     This is true by default.
  +   */
  +  public
  +  void setContextPrinting(boolean contextPrinting) {
  +    this.contextPrinting = contextPrinting;
  +  }
  +  
  +  /**
  +     Returns value of the <b>ContextPrinting</b> option.
  +   */
  +  public
  +  boolean getContextPrinting() {
  +    return contextPrinting;
  +  }
   
     /**
      In addition to the priority of the statement and message, the
  @@ -155,16 +205,8 @@
       buf.append(event.getRenderedMessage());
       buf.append(LINE_SEP);    
       return buf.toString();
  -  }
  -
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -              new String[] {THREAD_PRINTING_OPTION, CATEGORY_PREFIXING_OPTION,
  -  			    CONTEXT_PRINTING_OPTION});
  -
     }
  -
  +  
    /** 
        The TTCCLayout does not handle the throwable contained within
        {@link LoggingEvent LoggingEvents}. Thus, it returns
  @@ -174,79 +216,5 @@
     public
     boolean ignoresThrowable() {
       return true;
  -  }
  -
  -  
  -  /**
  -    <p>On top of the {@link DateLayout#setOption DateLayout} options
  -    <code>TTCCLayout</code> specific options are:
  -
  -    <dl>
  -
  -    
  -    <p><dt><b>ThreadPrinting</b>
  -
  -    <dd>If set to true, the printed message will include the name of
  -    the current thread. Is set to true by default.
  -    
  -    <p><dt><b>ContextPrinting</b>
  -
  -    <dd>If set to true, the printed message will include the nested
  -    context belonging to current thread. Is set to true by default.
  -    
  -    <p><dt><b>CategoryPrefixing</b>
  -
  -    <dd>If set to true, the printed message will include the category
  -    of the satetement as prefix. Is set to true by default.
  -
  -
  -    </dl> */
  -  public
  -  void setOption(String key, String value) {
  -    super.setOption(key, value);    
  -
  -    if(key.equalsIgnoreCase(THREAD_PRINTING_OPTION)) 
  -      threadPrinting = OptionConverter.toBoolean(value, threadPrinting);
  -    else if(key.equalsIgnoreCase(CATEGORY_PREFIXING_OPTION))
  -      categoryPrefixing = OptionConverter.toBoolean(value, categoryPrefixing);
  -    else if(key.equalsIgnoreCase(CONTEXT_PRINTING_OPTION))
  -      contextPrinting = OptionConverter.toBoolean(value, contextPrinting);
  -  }
  -  
  -  public
  -  String getOption(String key) {
  -    if(key.equalsIgnoreCase(THREAD_PRINTING_OPTION)) {
  -      return threadPrinting ? "true" : "false";
  -    } else if(key.equalsIgnoreCase(CATEGORY_PREFIXING_OPTION)) {
  -      return categoryPrefixing ? "true" : "false";
  -    } else if(key.equalsIgnoreCase(CONTEXT_PRINTING_OPTION)) {
  -      return contextPrinting ? "true" : "false";
  -    } else {
  -      return super.getOption(key);
  -    }
  -  }
  -
  -  /**
  -     Provides an alternate method to set the
  -     <code>CategoryPrefixing</code> option. Preferred method to set
  -     options is through a configuration file.
  -
  -     <p>See also {@link PropertyConfigurator}.  */
  -  public
  -  void setCategoryPrefixing(boolean categoryPrefixing) {
  -    this.categoryPrefixing = categoryPrefixing;    
  -  }
  -  
  -  
  -
  -  /**
  -     Provides an alternate method to set the
  -     <code>ThreadPrinting</code> option. Preferred method to set
  -     options is through the configuration file.
  -
  -     <p>Seel also {@link PropertyConfigurator} */
  -  public
  -  void setThreadPrinting(boolean threadPrinting) {
  -    this.threadPrinting = threadPrinting;    
     }
   } 
  
  
  
  1.8       +27 -64    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WriterAppender.java	2001/03/10 12:58:00	1.7
  +++ WriterAppender.java	2001/03/19 12:38:18	1.8
  @@ -30,17 +30,6 @@
      @author Ceki G&uuml;lc&uuml;
      @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.     
  -  */
  -  public static final String IMMEDIATE_FLUSH_OPTION = "ImmediateFlush";
  -
     /**
        Immediate flush means that the undelying writer or output stream
        will be flushed at the end of each append operation. Immediate
  @@ -96,7 +85,33 @@
       this.setWriter(writer);
     }
   
  +  /**
  +     If the <b>ImmediateFlush</b> option is set to
  +     <code>true</code>, the appender will flush at the end of each
  +     write. This is the default behaviour. If the option is set to
  +     <code>false</code>, then the underlying stream can defer writing
  +     to physical medium to a later time. 
   
  +     <p>Avoiding the flush operation at the end of each append results in
  +     a performance gain of 10 to 20 percent. However, there is safety
  +     tradeoff involved in skipping flushing. Indeed, when flushing is
  +     skipped, then it is likely that the last few log events will not
  +     be recorded on disk when the application exits. This is a high
  +     price to pay even for a 20% performance gain.
  +   */
  +  public
  +  void setImmediateFlush(boolean value) {
  +    immediateFlush = value;
  +  }
  +
  +  /**
  +     Returns value of the <b>ImmediateFlush</b> option.
  +   */
  +  public
  +  boolean getImmediateFlush() {
  +    return immediateFlush;
  +  }
  +
     /**
        Does nothing.
     */
  @@ -193,29 +208,8 @@
   	                                          // at  this late stage
         }
       }
  -  }
  -
  -  public
  -  String getOption(String key) {
  -    if (key.equalsIgnoreCase(IMMEDIATE_FLUSH_OPTION)) {
  -      return immediateFlush ? "true" : "false";
  -    } else {
  -      return super.getOption(key);
  -    }
  -  }
  -
  -
  -  /**
  -     Returns the option names for this component.
  -  */
  -  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. */
  @@ -232,37 +226,6 @@
       }    
     }
     
  -  
  -  /**
  -     Set WriterAppender specific options.
  -          
  -     <p><b>ImmediateFlush</b> If this option is set to
  -     <code>true</code>, the appender will flush at the end of each
  -     write. This is the default behaviour. If the option is set to
  -     <code>false</code>, then the underlying stream can defer writing
  -     to physical medium to a later time. 
  -
  -     <p>Avoiding the flush operation at the end of each append results in
  -     a performance gain of 10 to 20 percent. However, there is safety
  -     tradeoff involved in skipping flushing. Indeed, when flushing is
  -     skipped, then it is likely that the last few log events will not
  -     be recorded on disk when the application exits. This is a high
  -     price to pay even for a 20% performance gain.
  -
  -     <b>See</b> Options of the super class {@link
  -     org.apache.log4j.AppenderSkeleton}, in particular the
  -     <b>Threshold</b> option.
  -  */
  -  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
  
  
  
  1.4       +79 -69    jakarta-log4j/org/apache/log4j/gui/TextPaneAppender.java
  
  Index: TextPaneAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/gui/TextPaneAppender.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TextPaneAppender.java	2001/01/26 13:27:45	1.3
  +++ TextPaneAppender.java	2001/03/19 12:38:19	1.4
  @@ -177,19 +177,6 @@
       return textpane;
     }
     
  -  public String getLabel() {
  -    return label;
  -  }
  -
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {LABEL_OPTION, COLOR_OPTION_FATAL, COLOR_OPTION_ERROR,
  -			   COLOR_OPTION_WARN, COLOR_OPTION_INFO, COLOR_OPTION_DEBUG,
  -			   COLOR_OPTION_BACKGROUND, FANCY_OPTION,
  -			   FONT_NAME_OPTION, FONT_SIZE_OPTION};
  -  }
  -
  -  
     private
     static
     Color parseColor (String v) {
  @@ -243,7 +230,82 @@
       return c == null ? null : colorToString(c);
     }
     
  -  private
  +  /////////////////////////////////////////////////////////////////////
  +  // option setters and getters
  +  
  +  public
  +  void setLabel(String label) {
  +    this.label = label;
  +  }
  +  public
  +  String getLabel() {
  +    return label;
  +  }
  +  
  +  public
  +  void setColorEmerg(String color) {
  +    setColor(Priority.FATAL, color);
  +  }
  +  public
  +  String getColorEmerg() {
  +    return getColor(Priority.FATAL);
  +  }
  +  
  +  public
  +  void setColorError(String color) {
  +    setColor(Priority.ERROR, color);
  +  }
  +  public
  +  String getColorError() {
  +    return getColor(Priority.ERROR);
  +  }
  +  
  +  public
  +  void setColorWarn(String color) {
  +    setColor(Priority.WARN, color);
  +  }
  +  public
  +  String getColorWarn() {
  +    return getColor(Priority.WARN);
  +  }
  +  
  +  public
  +  void setColorInfo(String color) {
  +    setColor(Priority.INFO, color);
  +  }
  +  public
  +  String getColorInfo() {
  +    return getColor(Priority.INFO);
  +  }
  +  
  +  public
  +  void setColorDebug(String color) {
  +    setColor(Priority.DEBUG, color);
  +  }
  +  public
  +  String getColorDebug() {
  +    return getColor(Priority.DEBUG);
  +  }
  +  
  +  public
  +  void setColorBackground(String color) {
  +    textpane.setBackground(parseColor(color));
  +  }
  +  public
  +  String getColorBackground() {
  +    return colorToString(textpane.getBackground());
  +  }
  +  
  +  public
  +  void setFancy(boolean fancy) {
  +    this.fancy = fancy;
  +  }
  +  public
  +  boolean getFancy() {
  +    return fancy;
  +  }
  +  
  +  public
     void setFontSize(int size) {
       Enumeration e = attributes.elements();
       while (e.hasMoreElements()) {
  @@ -252,13 +314,13 @@
       return;
     }
     
  -  private
  +  public
     int getFontSize() {
       AttributeSet attrSet = (AttributeSet) attributes.get(Priority.INFO);
       return StyleConstants.getFontSize(attrSet);
     }
     
  -  private
  +  public
     void setFontName(String name) {
       Enumeration e = attributes.elements();
       while (e.hasMoreElements()) {
  @@ -267,62 +329,10 @@
       return;
     }
     
  -  private
  +  public
     String getFontName() {
       AttributeSet attrSet = (AttributeSet) attributes.get(Priority.INFO);
       return StyleConstants.getFontFamily(attrSet);
  -  }
  -  
  -  public
  -  void setOption(String option, String value) {
  -    if (option.equalsIgnoreCase(LABEL_OPTION))
  -      this.label=value;
  -    if (option.equalsIgnoreCase(COLOR_OPTION_FATAL))
  -      setColor(Priority.FATAL,value);
  -    if (option.equalsIgnoreCase(COLOR_OPTION_ERROR))
  -      setColor(Priority.ERROR,value);
  -    if (option.equalsIgnoreCase(COLOR_OPTION_WARN))
  -      setColor(Priority.WARN,value);
  -    if (option.equalsIgnoreCase(COLOR_OPTION_INFO))
  -      setColor(Priority.INFO,value);
  -    if (option.equalsIgnoreCase(COLOR_OPTION_DEBUG))
  -      setColor(Priority.DEBUG,value);
  -    if (option.equalsIgnoreCase(COLOR_OPTION_BACKGROUND))
  -      textpane.setBackground(parseColor(value));
  -    if (option.equalsIgnoreCase(FANCY_OPTION))
  -      fancy = OptionConverter.toBoolean(value, fancy);
  -    if (option.equalsIgnoreCase(FONT_SIZE_OPTION))
  -      setFontSize(Integer.parseInt(value));
  -    if (option.equalsIgnoreCase(FONT_NAME_OPTION))
  -      setFontName(value);
  -    return;
  -  }
  -     
  -  public
  -  String getOption(String key) {
  -    if (key.equalsIgnoreCase(LABEL_OPTION)) {
  -      return label;
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_FATAL)) {
  -      return getColor(Priority.FATAL);
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_ERROR)) {
  -      return getColor(Priority.ERROR);
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_WARN)) {
  -      return getColor(Priority.WARN);
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_INFO)) {
  -      return getColor(Priority.INFO);
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_DEBUG)) {
  -      return getColor(Priority.DEBUG);
  -    } else if (key.equalsIgnoreCase(COLOR_OPTION_BACKGROUND)) {
  -      return colorToString(textpane.getBackground());
  -    } else if (key.equalsIgnoreCase(FANCY_OPTION)) {
  -      return fancy ? "true" : "false";
  -    } else if (key.equalsIgnoreCase(FONT_SIZE_OPTION)) {
  -      return Integer.toString(getFontSize());
  -    } else if (key.equalsIgnoreCase(FONT_NAME_OPTION)) {
  -      return getFontName();
  -    } else {
  -      return super.getOption(key);
  -    }
     }
   
     public
  
  
  
  1.4       +41 -67    jakarta-log4j/org/apache/log4j/helpers/DateLayout.java
  
  Index: DateLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/helpers/DateLayout.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DateLayout.java	2001/01/26 13:27:46	1.3
  +++ DateLayout.java	2001/03/19 12:38:19	1.4
  @@ -45,8 +45,8 @@
   
     protected FieldPosition pos = new FieldPosition(0);
   
  -  final static public String DATE_FORMAT_OPTION = "DateFormat";
  -  final static public String TIMEZONE_OPTION = "TimeZone";  
  +  //final static public String DATE_FORMAT_OPTION = "DateFormat";
  +  //final static public String TIMEZONE_OPTION = "TimeZone";  
   
     private String timeZoneID;
     private String dateFormatOption;  
  @@ -55,24 +55,54 @@
     protected Date date = new Date();
   
   
  +  /**
  +    The value of the <b>DateFormat</b> option should be either an
  +    argument to the constructor of {@link SimpleDateFormat} or one of
  +    the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
  +   */
  +  public
  +  void setDateFormat(String dateFormat) {
  +    if (dateFormat != null) {
  +        dateFormatOption = dateFormat.toUpperCase();
  +    }
  +    setDateFormat(dateFormatOption, TimeZone.getDefault());
  +  }
  +
  +  /**
  +     Returns value of the <b>DateFormat</b> option.
  +   */
  +  public
  +  String getDateFormat() {
  +    return dateFormatOption;
  +  }
  +  
  +  /**
  +    The <b>TimeZoneID</b> option is a time zone ID string in the format
  +    expected by the {@link TimeZone#getTimeZone} method.
  +   */
  +  public
  +  void setTimeZone(String timeZone) {
  +    this.timeZoneID = timeZone;
  +  }
  +  
  +  /**
  +     Returns value of the <b>TimeZone</b> option.
  +   */
     public
  +  String getTimeZone() {
  +    return timeZoneID;
  +  }
  +  
  +  public
     void activateOptions() {
  -    
       setDateFormat(dateFormatOption);
       if(timeZoneID != null && dateFormat != null) {
         dateFormat.setTimeZone(TimeZone.getTimeZone(timeZoneID));
       }
     }
   
  -
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {DATE_FORMAT_OPTION, TIMEZONE_OPTION};
  -  }
  -
  -
     public
  -  void  dateFormat(StringBuffer buf, LoggingEvent event) {
  +  void dateFormat(StringBuffer buf, LoggingEvent event) {
       if(dateFormat != null) {
         date.setTime(event.timeStamp);
         dateFormat.format(date, buf, this.pos);
  @@ -80,11 +110,9 @@
       }
     }
   
  -
     /**
        Sets the {@link DateFormat} used to format time and date in the
        zone determined by <code>timeZone</code>.
  -
      */
     public
     void setDateFormat(DateFormat dateFormat, TimeZone timeZone) {
  @@ -92,11 +120,6 @@
       this.dateFormat.setTimeZone(timeZone);
     }
     
  -  public
  -  void setDateFormat(String dateFormatType) {
  -    setDateFormat(dateFormatType, TimeZone.getDefault());
  -  }
  -
     /**
        Sets the DateFormat used to format date and time in the time zone
        determined by <code>timeZone</code> parameter. The {@link DateFormat} used
  @@ -110,7 +133,6 @@
        <code>dateFormatType</code> is not one of the above, then the
        argument is assumed to be a date pattern for {@link
        SimpleDateFormat}.
  -     
     */
     public
     void setDateFormat(String dateFormatType, TimeZone timeZone) {
  @@ -135,54 +157,6 @@
       } else {
         this.dateFormat = new SimpleDateFormat(dateFormatType);
         this.dateFormat.setTimeZone(timeZone);
  -    }
  -  }
  -
  -  /**
  -     
  -     <p>The DateLayout specific options are:
  -     
  -    <dl>
  -     
  -    <p><dt><b>DateFormat</b>
  -
  -    <dd>The value of this option should be either an argument to the
  -    constructor of {@link SimpleDateFormat} or one of the srings
  -    "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
  -
  -    <p>See also the <b>%d</b> conversion specifier of the {@link
  -    org.apache.log4j.PatternLayout PatternLayout}.
  -    
  -    <p><dt><b>TimeZoneID</b>
  -
  -    <dd>A time zone ID string in the format expected by the {@link
  -    TimeZone#getTimeZone} method.
  -
  -    </dl>
  -
  -
  -   */
  -  public
  -  void setOption(String option, String value) {
  -    if(option.equalsIgnoreCase(DATE_FORMAT_OPTION)) {
  -      dateFormatOption = value.toUpperCase();
  -    } else if(option.equalsIgnoreCase(TIMEZONE_OPTION)) {
  -      timeZoneID = value;
  -    }
  -  }
  -  
  -  /**
  -     Returns the current value of the specified option, or null if
  -     it is not one of "DateFormat" or "TimeZoneID".
  -  */
  -  public
  -  String getOption(String option) {
  -    if(option.equalsIgnoreCase(DATE_FORMAT_OPTION)) {
  -      return dateFormatOption;
  -    } else if(option.equalsIgnoreCase(TIMEZONE_OPTION)) {
  -      return timeZoneID;
  -    } else {
  -      return null;
       }
     }
   }
  
  
  
  1.5       +4 -4      jakarta-log4j/org/apache/log4j/helpers/OnlyOnceErrorHandler.java
  
  Index: OnlyOnceErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/helpers/OnlyOnceErrorHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OnlyOnceErrorHandler.java	2001/01/29 23:34:03	1.4
  +++ OnlyOnceErrorHandler.java	2001/03/19 12:38:19	1.5
  @@ -52,26 +52,26 @@
   
     /**
        Returns <code>null</code> as <code>OnlyOnceErrorHandler</code>
  -     has no options.  */
  +     has no options.  
     public
     String[] getOptionStrings() {
       return null;
  -  }
  +  }*/
   
     /**
        No options to set.
  -  */
     public
     void setOption(String key, String value) {
     }
  +  */
   
     /**
        No options to get.
  -  */
     public
     String getOption(String key) {
       return null;
     }
  +  */
   
     /**
        Print a the error message passed as parameter on
  
  
  
  1.9       +43 -84    jakarta-log4j/org/apache/log4j/net/JMSAppender.java
  
  Index: JMSAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/net/JMSAppender.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JMSAppender.java	2001/02/27 23:38:26	1.8
  +++ JMSAppender.java	2001/03/19 12:38:19	1.9
  @@ -27,32 +27,9 @@
      @author Ceki G&uuml;lc&uuml;
   */
   public class JMSAppender extends AppenderSkeleton {
  -
     TopicConnection  topicConnection;
     TopicSession topicSession;
     TopicPublisher  topicPublisher;
  -
  -
  -  /**
  -     A string constant used in naming the topic connection factory
  -     binding name option.  output file. Current value of this string
  -     constant is <b>TopicConnectionFactoryBindingName</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION 
  -                                                 = "TopicConnectionFactoryBindingName";
  -
  -  /**
  -     A string constant used in naming the topic binding name option.
  -     Current value of this string constant is <b>TopicBindingName</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String TOPIC_BINDING_NAME_OPTION = "TopicBindingName";
  -
     String topicBindingName;
     String tcfBindingName;
   
  @@ -60,18 +37,43 @@
     JMSAppender() {
     }
   
  +  /**
  +     The <b>TopicConnectionFactoryBindingName</b> option takes a
  +     string value. Its value will be used to lookup the appropriate
  +     <code>TopicConnectionFactory</code> from the JNDI context.
  +   */
  +  public
  +  void setTopicConnectionFactoryBindingName(String tcfBindingName) {
  +    this.tcfBindingName = tcfBindingName;
  +  }
     
  -  protected
  -  Object lookup(Context ctx, String name) throws NamingException {
  -    try {
  -      return ctx.lookup(name);
  -    } catch(NameNotFoundException e) {
  -      LogLog.error("Could not find name ["+name+"].");
  -      throw e;
  -    }    
  +  /**
  +     Returns the value of the <b>TopicConnectionFactoryBindingName</b> option.
  +   */
  +  public
  +  String getTopicConnectionFactoryBindingName() {
  +    return tcfBindingName;
     }
     
  +  /**
  +     The <b>TopicBindingName</b> option takes a
  +     string value. Its value will be used to lookup the appropriate
  +     <code>Topic</code> from the JNDI context.
  +   */
     public
  +  void setTopicBindingName(String topicBindingName) {
  +    this.topicBindingName = topicBindingName;
  +  }
  +  
  +  /**
  +     Returns the value of the <b>TopicBindingName</b> option.
  +   */
  +  public
  +  String getTopicBindingName() {
  +    return topicBindingName;
  +  }
  +  
  +  public
     void activateOptions() {
       TopicConnectionFactory  topicConnectionFactory;
   
  @@ -95,6 +97,16 @@
     }
    
     protected
  +  Object lookup(Context ctx, String name) throws NamingException {
  +    try {
  +      return ctx.lookup(name);
  +    } catch(NameNotFoundException e) {
  +      LogLog.error("Could not find name ["+name+"].");
  +      throw e;
  +    }    
  +  }
  +  
  +  protected
     boolean checkEntryConditions() {
       String fail = null;
   
  @@ -156,59 +168,6 @@
       } catch(Exception e) {
         errorHandler.error("Could not publish message in JMSAppender ["+name+"].", e, 
   			 ErrorCode.GENERIC_FAILURE);
  -    }
  -  }
  -
  -
  - /**
  -     Retuns the option names for this component, namely the string
  -     array {@link #TOPIC_BINDING_NAME_OPTION}, {@link
  -     #TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION} in addition to the
  -     options of its super class {@link AppenderSkeleton}.  */
  -  
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -          new String[] {TOPIC_BINDING_NAME_OPTION, 
  -			  TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION});
  -  }
  -
  - /**
  -     Set <code>JMSAppender</code> specific options.
  -          
  -     The options of the super class {@link AppenderSkeleton} are also
  -     recognized.
  -
  -     <p>The <b>TopicConnectionFactoryBindingName</b> option takes a
  -     string value. Its value will be used to lookup the appropriate
  -     <code>TopicConnectionFactory</code> from the JNDI context.
  -
  -     <p>The <b>TopicBindingName</b> option takes a
  -     string value. Its value will be used to lookup the appropriate
  -     <code>Topic</code> from the JNDI context.         
  -     
  - */
  -
  -  public
  -  void setOption(String key, String value) {
  -    if(value == null) return;
  -    super.setOption(key, value);    
  -    
  -    if(key.equals(TOPIC_BINDING_NAME_OPTION)) 
  -      topicBindingName = value;
  -    else if(key.equals(TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION)) {
  -      tcfBindingName = value;
  -    }
  -  }
  -  
  -  public
  -  String getOption(String key) {
  -    if (key.equals(TOPIC_BINDING_NAME_OPTION)) {
  -      return topicBindingName;
  -    } else if(key.equals(TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION)) {
  -      return tcfBindingName;
  -    } else {
  -      return super.getOption(key);
       }
     }
   
  
  
  
  1.17      +110 -148  jakarta-log4j/org/apache/log4j/net/SMTPAppender.java
  
  Index: SMTPAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/net/SMTPAppender.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SMTPAppender.java	2001/02/23 21:43:47	1.16
  +++ SMTPAppender.java	2001/03/19 12:38:19	1.17
  @@ -46,79 +46,6 @@
      @author Ceki G&uuml;lc&uuml;
      @since 1.0 */
   public class SMTPAppender extends AppenderSkeleton {
  -
  -
  - /**
  -     A string constant used in naming the <em>To</em> field of
  -     outgoing e-mail output file. Current value of this string
  -     constant is <b>To</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String TO_OPTION = "To";
  -
  - /**
  -     A string constant used in naming the <em>From</em> field of
  -     outgoing e-mail output file. Current value of this string
  -     constant is <b>From</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String FROM_OPTION = "From";
  -
  - /**
  -     A string constant used in naming the <em>Subject</em> field of
  -     outgoing e-mail output file. Current value of this string
  -     constant is <b>Subject</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String SUBJECT_OPTION = "Subject";
  -
  -
  - /**
  -     A string constant used in naming the SMTP host that will be
  -     contacted to send the e-mail. Current value of this string
  -     constant is <b>SMTPHost</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String SMTP_HOST_OPTION = "SMTPHost";
  -
  - /**
  -     A string constant used in naming the cyclic buffer size option.
  -     Current value of this string constant is <b>BufferSize</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String BUFFER_SIZE_OPTION = "BufferSize";
  -
  -
  - /**
  -     A string constant used in naming the class of the
  -     TriggeringEventEvaluator that this SMTPApepdner wll use. Current
  -     value of this string constant is <b>EvaluatorClass</b>.
  -
  -     <p>Note that all option keys are case sensitive.
  -     
  -  */
  -  public static final String EVALUATOR_CLASS_OPTION = "EvaluatorClass";
  -
  -
  -  /**
  -     A string constant used in naming the option for setting the the
  -     location information flag.  Current value of this string
  -     constant is <b>LocationInfo</b>.  
  -
  -     <p>Note that all option keys are case sensitive.
  -  */
  -  public static final String LOCATION_INFO_OPTION = "LocationInfo";
  -
     String to;
     String from;
     String subject;
  @@ -246,18 +173,6 @@
       }
     }
   
  - /**
  -     Retuns the option names for this component in addition in
  -     addition to the options of its super class {@link
  -     AppenderSkeleton}.  */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -          new String[] {TO_OPTION, FROM_OPTION, SUBJECT_OPTION, 
  -			  SMTP_HOST_OPTION, BUFFER_SIZE_OPTION,  
  -			  EVALUATOR_CLASS_OPTION, LOCATION_INFO_OPTION });
  -  }
  -  
     InternetAddress[] parseAddress(String addressStr) {
       try {
         return InternetAddress.parse(addressStr, true);
  @@ -318,93 +233,140 @@
       }
     }
     
  - /**
  -     Set SMTPAppender specific options.
  -
  -     <p>On top of the options of the super class {@link
  -     AppenderSkeleton}, the recognized options are <b>To</b>,
  -     <b>From</b>, <b>Subject</b>, <b>SMTPHost</b>,
  -     <b>BufferSize</b>, <b>EvaluatorClass</b> and <b>LocationInfo</b>. 
  -     
  -     <p>The <b>To</b> option takes a string value which should be a
  +  /**
  +     The <b>To</b> option takes a string value which should be a
        comma separated list of e-mail address of the recipients.
  -
  -     <p>The <b>From</b> option takes a string value which should be a
  +   */
  +  public
  +  void setTo(String to) {
  +    this.to = to;
  +  }
  +  
  +  /**
  +     Returns value of the <b>To</b> option.
  +   */
  +  public
  +  String getTo() {
  +    return to;
  +  }
  +  
  +  /**
  +     The <b>From</b> option takes a string value which should be a
        e-mail address of the sender.
  -
  -     <p>The <b>Subject</b> option takes a string value which should be a
  +   */
  +  public
  +  void setFrom(String from) {
  +    this.from = from;
  +  }
  +  
  +  /**
  +     Returns value of the <b>From</b> option.
  +   */
  +  public
  +  String getFrom() {
  +    return from;
  +  }
  +  
  +  /**
  +     The <b>Subject</b> option takes a string value which should be a
        the subject of the e-mail message.
  -
  -     <p>The <b>SMTPHost</b> option takes a string value which should be a
  +   */
  +  public
  +  void setSubject(String subject) {
  +    this.subject = subject;
  +  }
  +  
  +  /**
  +     Returns value of the <b>Subject</b> option.
  +   */
  +  public
  +  String getSubject() {
  +    return subject;
  +  }
  +  
  +  /**
  +     The <b>SMTPHost</b> option takes a string value which should be a
        the host name of the SMTP server that will send the e-mail message.
  -
  -     <p>The <b>BufferSize</b>option takes a positive integer
  +   */
  +  public
  +  void setSMTPHost(String smtpHost) {
  +    this.smtpHost = smtpHost;
  +  }
  +  
  +  /**
  +     Returns value of the <b>SMTPHost</b> option.
  +   */
  +  public
  +  String getSMTPHost() {
  +    return smtpHost;
  +  }
  +  
  +  /**
  +     The <b>BufferSize</b>option takes a positive integer
        representing the maximum number of logging events to collect in a
        cyclic buffer. When the <code>BufferSize</code> is reached,
        oldest events are deleted as new events are added to the
        buffer. By default the size of the cyclic buffer is 512 events.
  +   */
  +  public
  +  void setBufferSize(int bufferSize) {
  +    this.bufferSize = bufferSize;
  +    cb.resize(bufferSize);
  +  }
   
  -     <p>The <b>EvaluatorClass</b> option takes a string value
  +  /**
  +     Returns value of the <b>BufferSize</b> option.
  +   */
  +  public
  +  int getBufferSize() {
  +    return bufferSize;
  +  }
  +  
  +  /**
  +     The <b>EvaluatorClass</b> option takes a string value
        repsenting the name of the class implementing the {@link
        TriggeringEventEvaluator} interface. A corresponding object will
        be instantiated and assigned as the triggering event evaluator
        for the SMTPAppender.
  -
  -     <p>The <b>LocationInfo</b> option takes a boolean value. By
  +   */
  +  public
  +  void setEvaluatorClass(String value) {
  +      evaluator = (TriggeringEventEvaluator) 
  +                OptionConverter.instantiateByClassName(value, 
  +					   TriggeringEventEvaluator.class,
  +						       evaluator);    
  +  }
  +  
  +  /**
  +     Returns value of the <b>EvaluatorClass</b> option.
  +   */
  +  public
  +  String getEvaluatorClass() {
  +    return evaluator == null ? null : evaluator.getClass().getName();
  +  }
  +  
  +  /**
  +     The <b>LocationInfo</b> option takes a boolean value. By
        default, it is set to false which means there will be no effort
        to extract the location information related to the event. As a
        result, the layout that formats the events as they are sent out
        in an e-mail is likely to place the wrong location information
        (if present in the format).
  -
  +     
        <p>Location information extraction is comparatively very slow and
        should be avoided unless performance is not a concern.
  -
  - */
  +   */
     public
  -  void setOption(String option, String value) {
  -    if(value == null) return;
  -    super.setOption(option, value);    
  -
  -    if(option.equals(TO_OPTION)) 
  -      to = value;
  -    else if (option.equals(FROM_OPTION))
  -      from = value;
  -    else if (option.equals(SMTP_HOST_OPTION)) 
  -      smtpHost = value;
  -    else if (option.equals(SUBJECT_OPTION)) 
  -      subject = value;
  -    else if (option.equals(EVALUATOR_CLASS_OPTION)) {      
  -      evaluator = (TriggeringEventEvaluator) 
  -                OptionConverter.instantiateByClassName(value, 
  -					   TriggeringEventEvaluator.class,
  -						       evaluator);    
  -    } else if (option.equals(BUFFER_SIZE_OPTION)) {
  -      bufferSize = OptionConverter.toInt(value, bufferSize);    
  -      cb.resize(bufferSize);
  -    } else if (option.equals(LOCATION_INFO_OPTION))
  -      locationInfo = OptionConverter.toBoolean(value, locationInfo);
  +  void setLocationInfo(boolean locationInfo) {
  +    this.locationInfo = locationInfo;
     }
     
  +  /**
  +     Returns value of the <b>LocationInfo</b> option.
  +   */
     public
  -  String getOption(String key) {
  -    if (key.equalsIgnoreCase(TO_OPTION)) {
  -      return to;
  -    } else if (key.equalsIgnoreCase(FROM_OPTION)) {
  -        return from;
  -    } else if (key.equalsIgnoreCase(SMTP_HOST_OPTION)) {
  -        return smtpHost;
  -    } else if (key.equalsIgnoreCase(SUBJECT_OPTION)) {
  -        return subject;
  -    } else if (key.equalsIgnoreCase(EVALUATOR_CLASS_OPTION)) {
  -        return evaluator == null ? null : evaluator.getClass().getName();
  -    } else if (key.equalsIgnoreCase(BUFFER_SIZE_OPTION)) {
  -        return Integer.toString(bufferSize);
  -    } else if (key.equalsIgnoreCase(LOCATION_INFO_OPTION)) {
  -        return locationInfo ? "true" : "false";
  -    } else {
  -      return super.getOption(key);
  -    }
  +  boolean getLocationInfo() {
  +    return locationInfo;
     }
   }
   
  
  
  
  1.7       +60 -108   jakarta-log4j/org/apache/log4j/net/SocketAppender.java
  
  Index: SocketAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/net/SocketAppender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SocketAppender.java	2001/02/06 15:14:20	1.6
  +++ SocketAppender.java	2001/03/19 12:38:20	1.7
  @@ -127,42 +127,6 @@
     //private static final int RESET_FREQUENCY = 70;
     private static final int RESET_FREQUENCY = 1;
   
  -  /**
  -     A string constant used in naming the option for setting the the
  -     host name of the remote server.  Current value of this string
  -     constant is <b>RemoteHost</b>. See the {@link #setOption} method
  -     for the meaning of this option.
  -
  -  */
  -  public static final String REMOTE_HOST_OPTION = "RemoteHost";
  -
  - /**
  -     A string constant used in naming the option for setting the the
  -     port to contect on the remote server.  Current value of this string
  -     constant is <b>Port</b>.  See the {@link #setOption} method
  -     for the meaning of this option.
  -
  -  */
  -  public static final String PORT_OPTION = "Port";
  -
  -  /**
  -     A string constant used in naming the option for setting the the
  -     location information flag.  Current value of this string
  -     constant is <b>LocationInfo</b>.  See the {@link #setOption} method
  -     for the meaning of this option.
  -
  -  */
  -  public static final String LOCATION_INFO_OPTION = "LocationInfo";
  -
  -  /**
  -     A string constant used in naming the option for setting the delay
  -     between each reconneciton attempt to remote server.  Current
  -     value a of this string constant is <b>ReconnectionDelay</b>.  See
  -     the {@link #setOption} method for the meaning of this option.
  -
  -  */
  -  public static final String RECONNECTION_DELAY_OPTION = "ReconnectionDelay";
  -
     public SocketAppender() {
     }
   
  @@ -308,23 +272,6 @@
     }
   
     /**
  -     Retuns the option names for this component, namely the string
  -     array consisting of {{@link #REMOTE_HOST_OPTION}, {@link
  -     #PORT_OPTION}, {@link #LOCATION_INFO_OPTION}, {@link
  -     #RECONNECTION_DELAY_OPTION}} in addition to the options of its
  -     super class {@link AppenderSkeleton}.
  -
  -    */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -                          new String[] {REMOTE_HOST_OPTION, PORT_OPTION, 
  -					LOCATION_INFO_OPTION,
  -					RECONNECTION_DELAY_OPTION});
  -  }
  -
  -
  -  /**
        The SocketAppender does not use a layout. Hence, this method returns
        <code>false</code>.
     */
  @@ -333,76 +280,81 @@
       return false;
     }
   
  -  
     /**
  -     Set SocketAppender specific options.
  -     
  -     <p>On top of the options of the super class {@link
  -     AppenderSkeleton}, the recognized options are <b>RemoteHost</b>,
  -     <b>Port</b> and <b>ReconnectionDelay</b>, i.e. the values of the
  -     string constants {@link #REMOTE_HOST_OPTION}, {@link
  -     #PORT_OPTION},{@link #LOCATION_INFO_OPTION} and respectively {@link
  -     #RECONNECTION_DELAY_OPTION}.
  -     
  -     <p>The <b>RemoteHost</b> option takes a string value which should be
  +     The <b>RemoteHost</b> option takes a string value which should be
        the host name of the server where a {@link SocketNode} is running.
  -
  -     <p>The <b>Port</b> option takes a positive integer representing
  +   */
  +  public
  +  void setRemoteHost(String host) {
  +    address = getAddressByName(host);
  +    remoteHost = host;
  +  }
  +  
  +  /**
  +     Returns value of the <b>RemoteHost</b> option.
  +   */
  +  public
  +  String getRemoteHost() {
  +    return remoteHost;
  +  }
  +  
  +  /**
  +     The <b>Port</b> option takes a positive integer representing
        the port where the server is waiting for connections.
  -
  -     <p>The <b>LocationInfo</b> option takes a boolean value. If true,
  +   */
  +  public
  +  void setPort(int port) {
  +    this.port = port;
  +  }
  +  
  +  /**
  +     Returns value of the <b>Port</b> option.
  +   */
  +  public
  +  int getPort() {
  +    return port;
  +  }
  +  
  +  /**
  +     The <b>LocationInfo</b> option takes a boolean value. If true,
        the information sent to the remote host will include location
        information. By default no location information is sent to the server.
  -     
  -     <p>The <b>ReconnectionDelay</b> option takes a positive integer
  +   */
  +  public
  +  void setLocationInfo(boolean locationInfo) {
  +    this.locationInfo = locationInfo;
  +  }
  +  
  +  /**
  +     Returns value of the <b>LocationInfo</b> option.
  +   */
  +  public
  +  boolean getLocationInfo() {
  +    return locationInfo;
  +  }
  +  
  +  /**
  +     The <b>ReconnectionDelay</b> option takes a positive integer
        representing the number of milliseconds to wait between each
        failed connection attempt to the server. The default value of
  -     this option is 30000 which corresponds to 30 seconds. 
  +     this option is 30000 which corresponds to 30 seconds.
        
        <p>Setting this option to zero turns off reconnection
  -     capability. 
  -         
  +     capability.
      */
     public
  -  void setOption(String option, String value) {
  -    if(value == null) return;
  -    super.setOption(option, value);    
  -
  -    if(option.equals(REMOTE_HOST_OPTION)) {
  -      address = getAddressByName(value);
  -      remoteHost = value;
  -    } else if (option.equals(PORT_OPTION)) {
  -      port = OptionConverter.toInt(value, port);
  -    } else if (option.equals(LOCATION_INFO_OPTION)) {
  -      locationInfo = OptionConverter.toBoolean(value, locationInfo);    
  -    } else if (option.equals(RECONNECTION_DELAY_OPTION)) {
  -      reconnectionDelay = OptionConverter.toInt(value, reconnectionDelay);  
  -    }
  +  void setReconnectionDelay(int delay) {
  +    this.reconnectionDelay = delay;
     }
     
  +  /**
  +     Returns value of the <b>ReconnectionDelay</b> option.
  +   */
     public
  -  String getOption(String key) {
  -    if(key.equals(REMOTE_HOST_OPTION)) {
  -      return remoteHost;
  -    } else if (key.equals(PORT_OPTION)) {
  -      if (port == DEFAULT_PORT) {
  -        return null;
  -      } else  {
  -        return Integer.toString(port);
  -      }
  -    } else if (key.equals(LOCATION_INFO_OPTION)) {
  -      return locationInfo ? "true" : "false";
  -    } else if (key.equals(RECONNECTION_DELAY_OPTION)) {
  -      if (reconnectionDelay == DEFAULT_RECONNECTION_DELAY) {
  -        return null;
  -      } else  {
  -        return Integer.toString(reconnectionDelay);
  -      }
  -    } else {
  -      return super.getOption(key);
  -    }
  +  int getReconnectionDelay() {
  +    return reconnectionDelay;
     }
  -
  +  
     /**
        The Connector will reconnect when the server becomes available
        again.  It does this by attempting to open a new connection every
  
  
  
  1.7       +41 -101   jakarta-log4j/org/apache/log4j/net/SyslogAppender.java
  
  Index: SyslogAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/net/SyslogAppender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SyslogAppender.java	2001/02/27 23:46:28	1.6
  +++ SyslogAppender.java	2001/03/19 12:38:20	1.7
  @@ -81,28 +81,6 @@
     /** reserved for local use*/
     final static public int LOG_LOCAL7 = 23<<3; 
   
  -   /**
  -     A string constant used in naming the option for setting the
  -     syslog server.  Current value of this string constant is
  -     <b>SyslogHost</b>.
  -     @since 0.8.1 */
  -  public static final String SYSLOG_HOST_OPTION = "SyslogHost";
  -
  -   /**
  -     A string constant used in naming the option for setting facility
  -     type.  Current value of this string constant is <b>Facility</b>.
  -
  -     @since 0.8.1 */
  -  public static final String FACILITY_OPTION = "Facility";  
  -
  -   /**
  -     A string constant used in naming the option for setting whether
  -     the facility name is printed or not.  Current value of this
  -     string constant is <b>FacilityPrinting</b>.
  -
  -     @since 0.8.1 */
  -  public static final String FACILITY_PRINTING_OPTION = "FacilityPrinting";  
  -
     protected static final int SYSLOG_HOST_OI = 0;
     protected static final int FACILITY_OI = 1;
     
  @@ -293,21 +271,7 @@
     void activateOptions() {
     }
   
  -  
     /**
  -     Returns the option names for this component, namely the string
  -     array consisting of {{@link #SYSLOG_HOST_OPTION}, {@link
  -     #FACILITY_OPTION}, {@link #FACILITY_PRINTING_OPTION}}.
  -
  -     @since 0.8.1 */
  -  public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -		      new String[] {SYSLOG_HOST_OPTION, FACILITY_OPTION,
  -			            FACILITY_PRINTING_OPTION});
  -  }
  -  
  -  /**
        The SyslogAppender requires a layout. Hence, this method returns
        <code>true</code>.
   
  @@ -317,8 +281,31 @@
       return true;
     }
     
  +  /**
  +    The <b>SyslogHost</b> option is the name of the the syslog host
  +    where log output should go.
  +
  +    <b>WARNING</b> If the SyslogHost is not set, then this appender
  +    will fail. 
  +   */
  +  public
  +  void setSyslogHost(String syslogHost) {
  +    this.sqw = new SyslogQuietWriter(new SyslogWriter(syslogHost), 
  +				     syslogFacility, errorHandler);
  +    this.stp = new SyslogTracerPrintWriter(sqw);    
  +    this.syslogHost = syslogHost;
  +  }
  +  
  +  /**
  +     Returns the value of the <b>SyslogHost</b> option.
  +   */
  +  public
  +  String getSyslogHost() {
  +    return syslogHost;
  +  }
  +  
     /**
  -     Set the syslog facility.
  +     Set the syslog facility. This is the <b>Facility</b> option.
   
        <p>The <code>facilityName</code> parameter must be one of the
        strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP,
  @@ -344,78 +331,31 @@
       if(sqw != null) {
         sqw.setSyslogFacility(this.syslogFacility);
       }
  -
     }
     
     /**
  -    Set SyslogAppender specific parameters. 
  -
  -    <p>The recognized options are <b>SyslogHost</b>, <b>Facility</b> and
  -    <b>FacilityPrinting</b>, i.e. the values of the string constants
  -    {@link #SYSLOG_HOST_OPTION}, {@link #FACILITY_OPTION} and {@link
  -    #FACILITY_PRINTING_OPTION} respectively.
  -     
  -    <dl>
  -
  -    <p><dt><b>SyslogHost</b>
  -
  -    <dd>The host name of the syslog host where log output should
  -    go.
  -
  -    <b>WARNING</b> If the SyslogHost is not set, then this appender
  -    will fail. 
  -
  -
  -     <p><dt><b>Facility</b>
  -
  -     A string representing the syslog facility.
  -
  -     <p>Acceptable values are in the set {KERN, USER, MAIL, DAEMON,
  -     AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP LOCAL0,
  -     LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7}.
  -    
  -    <p><dt><b>FacilityPrinting</b>
  -
  -    <dd>If set to true, the printed message will include the facility
  -    name of the application. Is set to <em>false</em> by default.
  -    
  -    </dl>
  -
  -    <p>
  -    @since 0.8.1 */
  +     Returns the value of the <b>Facility</b> option.
  +   */
     public
  -  void setOption(String option, String value) {
  -    if(value == null) return;
  -    
  -    super.setOption(option, value);    
  -    
  -    if(option.equals(SYSLOG_HOST_OPTION)) 
  -      this.setSyslogHost(value);
  -    else if(option.equals(FACILITY_PRINTING_OPTION))
  -      facilityPrinting = OptionConverter.toBoolean(value, facilityPrinting);
  -    else if(option.equals(FACILITY_OPTION)) {
  -      this.setFacility(value);
  -    }
  +  String getFacility() {
  +    return getFacilityString(syslogFacility);
     }
     
  +  /**
  +    If the <b>FacilityPrinting</b> option is set to true, the printed
  +    message will include the facility name of the application. It is
  +    <em>false</em> by default.
  +   */
     public
  -  String getOption(String option) {
  -    if(option.equals(SYSLOG_HOST_OPTION)) {
  -      return syslogHost;
  -    } else if(option.equals(FACILITY_PRINTING_OPTION)) {
  -      return facilityPrinting ? "true" : "false";
  -    } else if(option.equals(FACILITY_OPTION)) {
  -      return getFacilityString(syslogFacility);
  -    } else {
  -      return super.getOption(option);
  -    }
  +  void setFacilityPrinting(boolean on) {
  +    facilityPrinting = on;
     }
  -
  +  
  +  /**
  +     Returns the value of the <b>FacilityPrinting</b> option.
  +   */
     public
  -  void setSyslogHost(String syslogHost) {
  -    this.sqw = new SyslogQuietWriter(new SyslogWriter(syslogHost), 
  -				     syslogFacility, errorHandler);
  -    this.stp = new SyslogTracerPrintWriter(sqw);    
  -    this.syslogHost = syslogHost;
  +  boolean getFacilityPrinting() {
  +    return facilityPrinting;
     }
   }
  
  
  
  1.9       +10 -25    jakarta-log4j/org/apache/log4j/nt/NTEventLogAppender.java
  
  Index: NTEventLogAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/nt/NTEventLogAppender.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NTEventLogAppender.java	2001/03/10 12:59:42	1.8
  +++ NTEventLogAppender.java	2001/03/19 12:38:20	1.9
  @@ -31,12 +31,6 @@
   public class NTEventLogAppender extends AppenderSkeleton {
     private int _handle = 0;
   
  -  /**
  -     The string constant used in naming the source of the event. The
  -     current value of this constant is <b>Source</b>.
  -
  -   */
  -  public static final String SOURCE_OPTION = "Source";
     private String source = null;
     private String server = null;
   
  @@ -130,30 +124,21 @@
       deregisterEventSource(_handle);
       _handle = 0;
     }
  -
  +  
     /**
  -     Returns the option names for this component.
  -   **/
  +     The <b>Source</b> option which names the source of the event. The
  +     current value of this constant is <b>Source</b>.
  +   */
     public
  -  String[] getOptionStrings() {
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -          new String[] {SOURCE_OPTION});
  +  void setSource(String source) {
  +    this.source = source.trim();
     }
  -
  -
  +  
     public
  -  void setOption(String key, String value) {
  -    if(value == null) return;
  -    super.setOption(key, value);
  -    
  -
  -    if(key.equalsIgnoreCase(SOURCE_OPTION)) {
  -      // Set the source for the NT Evetns
  -      source = value.trim();
  -    }
  +  String getSource() {
  +    return source;
     }
  -
  -
  +  
   /**
        The <code>NTEventLogAppender</code> requires a layout. Hence,
        this method always returns <code>true</code>. */
  
  
  
  1.5       +7 -30     jakarta-log4j/org/apache/log4j/spi/OptionHandler.java
  
  Index: OptionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/spi/OptionHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OptionHandler.java	2001/01/26 13:27:46	1.4
  +++ OptionHandler.java	2001/03/19 12:38:20	1.5
  @@ -10,7 +10,6 @@
   package org.apache.log4j.spi;
   
   /**
  -
      A string based interface to configure package components.
   
      @author Ceki G&uuml;lc&uuml;
  @@ -20,39 +19,17 @@
   public interface OptionHandler {
   
     /**
  -     Activate the options that were previously set with calls to {@link
  -     #setOption setOption}.
  +     Activate the options that were previously set with calls to option
  +     setters.
   
        <p>This allows to defer activiation of the options until all
        options have been set. This is required for components which have
        related options that remain ambigous until all are set.
  -
  -     <p>For example, the FileAppender has the "File" and "Append" options
  -     both of which are ambigous until the other is also set.
  -  */
  -  void activateOptions();  
  -
  -  /**
  -     Return list of strings that the OptionHandler instance recognizes.
  -   */
  -  String[] getOptionStrings();
   
  -  /**
  -     Set <code>option</code> to <code>value</code>.
  -
  -     <p>The handling of each option depends on the OptionHandler
  -     instance. Some options may become active immediately whereas
  -     other may be activated only when {@link #activateOptions} is
  -     called.
  -
  -  */
  -  void setOption(String option, String value);
  -  
  -  /**
  -     Returns the current value of the specified option, or null
  -     if the option name is unkown or undefined.
  -     
  -     @since 1.1
  +     <p>For example, the FileAppender has the
  +     {@link FileAppender#setFile File} and
  +     {@link FileAppender#setAppend Append} options both of which are
  +     ambigous until the other is also set.
     */
  -  String getOption(String option);
  +  void activateOptions();
   }
  
  
  
  1.4       +3 -84     jakarta-log4j/org/apache/log4j/test/PrintProperties.java
  
  Index: PrintProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/test/PrintProperties.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PrintProperties.java	2001/01/26 14:27:18	1.3
  +++ PrintProperties.java	2001/03/19 12:38:20	1.4
  @@ -8,9 +8,8 @@
   
   package org.apache.log4j.test;
   
  -import java.util.*;
  -import org.apache.log4j.*;
  -import org.apache.log4j.spi.OptionHandler;
  +import java.io.*;
  +import org.apache.log4j.config.PropertyPrinter;
   
   /**
      Prints the configuration of the log4j default hierarchy
  @@ -20,89 +19,9 @@
      @author  Anders Kristensen
    */
   public class PrintProperties {
  -  protected int numAppenders = 0;
  -  protected Hashtable appenderNames  = new Hashtable();
  -  protected Hashtable layoutNames  = new Hashtable();
  -  
     public
     static
     void main(String[] args) {
  -    new PrintProperties().print();
  -  }
  -  
  -  protected
  -  String genAppName() {
  -    return "A" + numAppenders++;
  -  }
  -  
  -  /**
  -     Returns true if the specified appender name is considered to have
  -     been generated, i.e. if it is of the form A[0-9]+.
  -  */
  -  protected
  -  boolean isGenAppName(String name) {
  -    if (name.length() < 2 || name.charAt(0) != 'A') return false;
  -    
  -    for (int i = 0; i < name.length(); i++) {
  -      if (name.charAt(i) < '0' || name.charAt(i) > '9') return false;
  -    }
  -    return true;
  -  }
  -  
  -  public
  -  void print() {
  -    printOptions(Category.getRoot());
  -    
  -    Enumeration cats = Category.getCurrentCategories();
  -    while (cats.hasMoreElements()) {
  -      printOptions((Category) cats.nextElement());
  -    }
  -  }
  -  
  -  public
  -  void printOptions(Category cat) {
  -    Enumeration appenders = cat.getAllAppenders();
  -    String appenderString = "";
  -    
  -    while (appenders.hasMoreElements()) {
  -      Appender app = (Appender) appenders.nextElement();
  -      String name;
  -      
  -      if ((name = (String) appenderNames.get(app)) == null) {
  -      
  -        // first assign name to the appender
  -        if ((name = app.getName()) == null || isGenAppName(name)) {
  -            name = genAppName();
  -        }
  -        appenderNames.put(app, name);
  -        
  -        if (app instanceof OptionHandler) {
  -          printOptions((OptionHandler) app, "log4j.appender."+name);
  -        }
  -        if (app.getLayout() != null) {
  -          printOptions(app.getLayout(), "log4j.appender."+name+".layout");
  -        }
  -      }
  -      appenderString += ", " + name;
  -    }
  -    String catKey = (cat == Category.getRoot())
  -        ? "log4j.rootCategory"
  -        : "log4j.category." + cat.getName();
  -    System.out.println(catKey + "=" + cat.getPriority() + appenderString);
  -  }
  -  
  -  public
  -  void printOptions(OptionHandler oh, String fullname) {
  -    String[] options = oh.getOptionStrings();
  -    
  -    System.out.println(fullname + "=" + oh.getClass().getName());
  -    
  -    for (int i = 0; i < options.length; i++) {
  -      String val = oh.getOption(options[i]);
  -      if (val != null) {
  -        System.out.println(fullname + "." + options[i] +
  -                   "=" + oh.getOption(options[i]));
  -      }
  -    }
  +    new PropertyPrinter(new PrintWriter(System.out), true);
     }
   }
  
  
  
  1.5       +6 -12     jakarta-log4j/org/apache/log4j/test/UnitTestDRFA.java
  
  Index: UnitTestDRFA.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/test/UnitTestDRFA.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UnitTestDRFA.java	2001/02/21 22:28:18	1.4
  +++ UnitTestDRFA.java	2001/03/19 12:38:20	1.5
  @@ -29,33 +29,27 @@
     void testComputeCheckPeriod() {
       DailyRollingFileAppender drfa = new DailyRollingFileAppender();
       drfa.setName("testComputeCheckPeriod");
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "yyyy-MM-dd.'log'");
  +    drfa.setDatePattern("yyyy-MM-dd.'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.TOP_OF_DAY);
   
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "yyyy-MM-dd mm.'log'");
  +    drfa.setDatePattern("yyyy-MM-dd mm.'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.TOP_OF_MINUTE);
   
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "yyyy-MM-dd a.'log'");
  +    drfa.setDatePattern("yyyy-MM-dd a.'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.HALF_DAY);
   
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "yyyy-MM-dd HH.'log'");
  +    drfa.setDatePattern("yyyy-MM-dd HH.'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.TOP_OF_HOUR);
   
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "yyyy-MM.'log'");
  +    drfa.setDatePattern("yyyy-MM.'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.TOP_OF_MONTH);
   
  -    drfa.setOption(DailyRollingFileAppender.DATE_PATTERN_OPTION, 
  -		   "'log'HH'log'");
  +    drfa.setDatePattern("'log'HH'log'");
       assertEquals(drfa.computeCheckPeriod(), 
   		 DailyRollingFileAppender.TOP_OF_HOUR);
     }
  
  
  
  1.6       +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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- confParsing	2001/02/19 13:44:28	1.5
  +++ confParsing	2001/03/19 12:38:20	1.6
  @@ -198,7 +198,7 @@
     lecho "log4j.configDebug=false"
     lecho "log4j.appender.testAppender=org.apache.log4j.ConsoleAppender"
     lecho "log4j.appender.testAppender.Target=  System.out  "
  -  lecho "log4j.appender.testAppender.Append= true  "
  +#  lecho "log4j.appender.testAppender.Append= true  "
     lecho "log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout"
     lecho "log4j.appender.testAppender.layout.ConversionPattern=[%t] %p - %m%n"
      echo -n " ConfigurationParsing test $TEST (can fail if anything is written to System.err) - "
  @@ -225,7 +225,7 @@
   # Test variable subst from the config file itself
   TEST=11;
   if [ $TEST -ge $start ]; then
  -  D_FLAG=""
  +  D_FALG=""
     echo  "log4j.rootCategory= DEBUG , testAppender" > $LCF
     lecho "log4j.configDebug=false"
     # $TEMP will be replaced by the shell
  
  
  
  1.4       +1 -3      jakarta-log4j/org/apache/log4j/test/getOptions
  
  Index: getOptions
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/test/getOptions,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- getOptions	2001/02/13 17:37:34	1.3
  +++ getOptions	2001/03/19 12:38:21	1.4
  @@ -16,7 +16,7 @@
      touch $TEMP
    fi
   
  - java $1 org.apache.log4j.test.PrintProperties > $TEMP
  + java $1 -Dlog4j.configuration=$LCF org.apache.log4j.test.PrintProperties | sort > $TEMP
   
    check witness/getOptions.$TEST $TEMP; echo "OK."
   }
  @@ -24,8 +24,6 @@
   
   
   declare -i TEST
  -
  -LCF=log4j.properties
   
   function createProperties {
     echo -n "" > $LCF
  
  
  
  1.4       +9 -8      jakarta-log4j/org/apache/log4j/test/witness/getOptions.1
  
  Index: getOptions.1
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/test/witness/getOptions.1,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- getOptions.1	2001/02/13 17:37:47	1.3
  +++ getOptions.1	2001/03/19 12:38:21	1.4
  @@ -1,8 +1,9 @@
  -log4j.appender.f=org.apache.log4j.FileAppender
  -log4j.appender.f.ImmediateFlush=true
  -log4j.appender.f.File=temp
  -log4j.appender.f.Append=false
  -log4j.appender.f.layout=org.apache.log4j.PatternLayout
  -log4j.appender.f.layout.ConversionPattern=%m%n
  -log4j.rootCategory=DEBUG, f
  -log4j.category.org.apache.log4j=INFO, f
  +log4j.appender.f.Append=false
  +log4j.appender.f.File=temp
  +log4j.appender.f.ImmediateFlush=true
  +log4j.appender.f.layout.ContentType=text/plain
  +log4j.appender.f.layout.ConversionPattern=%m%n
  +log4j.appender.f.layout=org.apache.log4j.PatternLayout
  +log4j.appender.f=org.apache.log4j.FileAppender
  +log4j.category.org.apache.log4j=INFO, f
  +log4j.rootCategory=DEBUG, f
  
  
  
  1.4       +0 -24     jakarta-log4j/org/apache/log4j/varia/DenyAllFilter.java
  
  Index: DenyAllFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/varia/DenyAllFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DenyAllFilter.java	2001/01/26 13:27:47	1.3
  +++ DenyAllFilter.java	2001/03/19 12:38:22	1.4
  @@ -32,29 +32,5 @@
     int decide(LoggingEvent event) {
       return Filter.DENY;
     }
  -  
  -  /**
  -     Returns <code>null</code> as there are no options.
  -  */
  -  public
  -  String[] getOptionStrings() {
  -    return null;
  -  }
  -
  -  
  -  /**
  -     No options to set.
  -  */
  -  public
  -  void setOption(String key, String value) {
  -  }
  -  
  -  /**
  -     No options to get.
  -  */
  -  public
  -  String getOption(String key) {
  -    return null;
  -  }
   }
   
  
  
  
  1.6       +18 -51    jakarta-log4j/org/apache/log4j/varia/ExternallyRolledFileAppender.java
  
  Index: ExternallyRolledFileAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/varia/ExternallyRolledFileAppender.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ExternallyRolledFileAppender.java	2001/02/28 00:20:20	1.5
  +++ ExternallyRolledFileAppender.java	2001/03/19 12:38:22	1.6
  @@ -39,16 +39,6 @@
      @since version 0.9.0 */
   public class ExternallyRolledFileAppender extends RollingFileAppender {
   
  -
  -  /**
  -     A string constant used in naming the option for setting the port
  -     for listening to external roll over messages. Current value of
  -     this string constant is <b>Port</b>.  
  -
  -     <p>All option keys are case sensitive.  */
  -
  -  static final public String PORT_OPTION = "Port";
  -
     /**
        The string constant sent to initiate a roll over.   Current value of
        this string constant is <b>RollOver</b>.  
  @@ -70,8 +60,25 @@
     public
     ExternallyRolledFileAppender() { 
     }
  -
  +  
     /**
  +     The <b>Port</b> option is used for setting the port for 
  +     listening to external roll over messages.
  +   */
  +  public
  +  void setPort(int port) {
  +    this.port = port;
  +  }
  +  
  +  /**
  +     Returns value of the <b>Port</b> option.
  +   */
  +  public
  +  int getPort() {
  +    return port;
  +  }
  +  
  +  /**
        Start listening on the port specified by a preceding call to
        {@link #setOption}.  */
     public
  @@ -85,46 +92,6 @@
         hup.setDaemon(true);
         hup.start();
       }
  -  }
  -
  -  /**
  -     Returns the option names for this component, namely {@link
  -     #PORT_OPTION} in addition to the options of its super class {@link
  -     RollingFileAppender#getOptionStrings FileAppender}.  */
  -  public
  -  String[] getOptionStrings() {
  -
  -    return OptionConverter.concatanateArrays(super.getOptionStrings(),
  -		 new String[] {PORT_OPTION});
  -  }
  -
  -  /**
  -     Set ExternallyRolledFileAppender specific options.
  -
  -     In addition to {@link FileAppender#setOption FileAppender
  -     options} and {@link RollingFileAppender#setOption RollingFileAppender
  -     options}, ExternallyRolledFileAppender recognizes the option
  -     <b>Port</b>.
  -
  -     <p>The <b>Port</b> option is used for setting the port for 
  -     listening to external roll over messages.
  -
  -   */
  -  public
  -  void setOption(String option, String value) {
  -    super.setOption(option, value);    
  -    if(option.equalsIgnoreCase(PORT_OPTION)) {
  -      port = OptionConverter.toInt(value, port);
  -      LogLog.debug("Port option set to "+port); 
  -    }
  -  }
  -  
  -  public
  -  String getOption(String option) {
  -    if (option.equalsIgnoreCase(PORT_OPTION)) {
  -      return port == 0 ? null : Integer.toString(port);
  -    }
  -    return super.getOption(option);
     }
   }
   
  
  
  
  1.4       +20 -32    jakarta-log4j/org/apache/log4j/varia/PriorityMatchFilter.java
  
  Index: PriorityMatchFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/varia/PriorityMatchFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PriorityMatchFilter.java	2001/01/26 13:27:47	1.3
  +++ PriorityMatchFilter.java	2001/03/19 12:38:22	1.4
  @@ -30,13 +30,6 @@
   
      @since 0.9.1 */
   public class PriorityMatchFilter extends Filter {
  -
  -  
  -  public static final String PRIORITY_TO_MATCH_OPTION = "PriorityToMatch";
  -
  -  /**
  -   */
  -  public static final String ACCEPT_ON_MATCH_OPTION = "AcceptOnMatch";
     
     /**
        Do we return ACCEPT when a match occurs. Default is
  @@ -47,6 +40,26 @@
      */
     Priority priorityToMatch;
   
  +  public
  +  void setPriorityToMatch(String priority) {
  +    priorityToMatch = Priority.toPriority(priority, null);
  +  }
  +  
  +  public
  +  String getPriorityToMatch() {
  +    return priorityToMatch == null ? null : priorityToMatch.toString();
  +  }
  +  
  +  public
  +  void setAcceptOnMatch(boolean acceptOnMatch) {
  +    this.acceptOnMatch = acceptOnMatch;
  +  }
  +  
  +  public
  +  boolean getAcceptOnMatch() {
  +    return acceptOnMatch;
  +  }
  +  
   
     /**
        Return the decision of this filter.
  @@ -85,31 +98,6 @@
         return Filter.DENY;
       } else {
         return Filter.ACCEPT;
  -    }
  -  }
  -
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {PRIORITY_TO_MATCH_OPTION, ACCEPT_ON_MATCH_OPTION};
  -  }
  -
  -  public
  -  void setOption(String key, String value) {    
  -    if(key.equalsIgnoreCase(PRIORITY_TO_MATCH_OPTION)) {
  -      priorityToMatch = Priority.toPriority(value, null);
  -    } else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
  -      acceptOnMatch = OptionConverter.toBoolean(value, acceptOnMatch);
  -    }
  -  }
  -  
  -  public
  -  String getOption(String key) {  
  -    if(key.equalsIgnoreCase(PRIORITY_TO_MATCH_OPTION)) {
  -      return priorityToMatch == null ? null : priorityToMatch.toString();
  -    } else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
  -      return acceptOnMatch ? "true" : "false";
  -    } else {
  -      return null;
       }
     }
   }
  
  
  
  1.5       +20 -34    jakarta-log4j/org/apache/log4j/varia/StringMatchFilter.java
  
  Index: StringMatchFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/varia/StringMatchFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StringMatchFilter.java	2001/01/26 13:27:47	1.4
  +++ StringMatchFilter.java	2001/03/19 12:38:22	1.5
  @@ -32,17 +32,29 @@
   
      @since 0.9.0 */
   public class StringMatchFilter extends Filter {
  -
     
  -  public static final String STRING_TO_MATCH_OPTION = "StringToMatch";
  -
  -  /**
  -   */
  -  public static final String ACCEPT_ON_MATCH_OPTION = "AcceptOnMatch";
  -  
     boolean acceptOnMatch = true;
     String stringToMatch;
  -
  +  
  +  public
  +  void setStringToMatch(String s) {
  +    stringToMatch = s;
  +  }
  +  
  +  public
  +  String getStringToMatch() {
  +    return stringToMatch;
  +  }
  +  
  +  public
  +  void setAcceptOnMatch(boolean acceptOnMatch) {
  +    this.acceptOnMatch = acceptOnMatch;
  +  }
  +  
  +  public
  +  boolean getAcceptOnMatch() {
  +    return acceptOnMatch;
  +  }
   
     /**
        Returns {@link Filter#NEUTRAL} is there is no string match.
  @@ -63,32 +75,6 @@
         } else {
   	return Filter.DENY;
         }
  -    }
  -  }
  -
  -  public
  -  String[] getOptionStrings() {
  -    return new String[] {STRING_TO_MATCH_OPTION, ACCEPT_ON_MATCH_OPTION};
  -  }
  -
  -  public
  -  void setOption(String key, String value) { 
  -    
  -    if(key.equalsIgnoreCase(STRING_TO_MATCH_OPTION)) {
  -      stringToMatch = value;
  -    } else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
  -      acceptOnMatch = OptionConverter.toBoolean(value, acceptOnMatch);
  -    }
  -  }
  -  
  -  public
  -  String getOption(String key) {
  -    if(key.equalsIgnoreCase(STRING_TO_MATCH_OPTION)) {
  -      return stringToMatch;
  -    } else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
  -      return acceptOnMatch ? "true" : "false";
  -    } else {
  -      return null;
       }
     }
   }
  
  
  
  1.10      +24 -48    jakarta-log4j/org/apache/log4j/xml/XMLLayout.java
  
  Index: XMLLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/XMLLayout.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLLayout.java	2001/02/28 00:33:13	1.9
  +++ XMLLayout.java	2001/03/19 12:38:22	1.10
  @@ -50,24 +50,34 @@
     private boolean locationInfo = false;
   
     /**
  -     This is a string constant to name the option for setting the
  -     location information flag. Current value of this string constant
  -     is <b>LocationInfo</b>. 
  -
  -     <p>See the {@link #setOption(java.lang.String, java.lang.String)}
  -     method for the meaning of this option.  
  -
  -     <p>Note all option keys are case sensitive.
  -     
  -  */
  -  public static final String LOCATION_INFO_OPTION = "LocationInfo";
  -
  +     The <b>LocationInfo</b> option takes a boolean value. By
  +     default, it is set to false which means there will be no location
  +     information output by this layout. If the the option is set to
  +     true, then the file name and line number of the statement
  +     at the origin of the log statement will be output. 
  +
  +     <p>If you are embedding this layout within an {@link
  +     org.apache.log4j.net.SMTPAppender} then make sure to set the
  +     <b>LocationInfo</b> option of that appender as well.
  +   */
     public
  +  void setLocationInfo(boolean flag) {
  +    locationInfo = flag;
  +  }
  +  
  +  /**
  +     Returns the current value of the <b>LocationInfo</b> option.
  +   */
  +  public
  +  boolean getLocationInfo() {
  +    return locationInfo;
  +  }
  +  
  +  public
     void activateOptions() {
     }
   
   
  -
     /**
        Formats a {@link LoggingEvent} in conformance with the log4j.dtd.  */
     public
  @@ -128,14 +138,8 @@
       buf.append("</log4j:event>\r\n\r\n");
   
       return buf.toString();
  -  }
  -
  -  public
  -  String[] getOptionStrings() {
  -    return new String[]{LOCATION_INFO_OPTION};
     }
  -
  -
  +  
     /**
        The XMLLayout prints and does not ignore exceptions. Hence the
        return value <code>false</code>.
  @@ -143,33 +147,5 @@
     public
     boolean ignoresThrowable() {
       return false;
  -  }
  -
  -
  -  /**
  -
  -     The XMLLayout specific options are:
  -
  -     <p>The <b>LocationInfo</b> option takes a boolean value. If true,
  -     the output will include location information. By default no
  -     location information is sent to the server.
  -  
  -  */
  -  public
  -  void setOption(String key, String value) {
  -
  -    if(value == null) return;
  -    if (key.equals(LOCATION_INFO_OPTION)) {
  -      locationInfo = OptionConverter.toBoolean(value, locationInfo);    
  -    } 
  -  }
  -  
  -  public
  -  String getOption(String key) {
  -    if (key.equals(LOCATION_INFO_OPTION)) {
  -      return locationInfo ? "true" : "false";    
  -    } else {
  -      return null;
  -    }
     }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-cvs-help@jakarta.apache.org