yoavs       2004/12/14 10:47:35

  Modified:    docs     HISTORY.txt
               src/java/org/apache/log4j/net SMTPAppender.java
  Log:
  Bugzilla 20985.
  
  Revision  Changes    Path
  1.13      +12 -9     logging-log4j/docs/HISTORY.txt
  
  Index: HISTORY.txt
  ===================================================================
  RCS file: /home/cvs/logging-log4j/docs/HISTORY.txt,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HISTORY.txt       13 Dec 2004 19:54:29 -0000      1.12
  +++ HISTORY.txt       14 Dec 2004 18:47:35 -0000      1.13
  @@ -12,25 +12,28 @@
    - Release of version 1.3alpha-4
   
    - Fixed Bugzilla 15198: TelnetAppender: NullPointerException if
  -   SocketHandler not initialized.
  +   SocketHandler not initialized. [*]
   
  - - Implemented Bugzilla 14934: MDC#setContext method added.
  + - Implemented Bugzilla 14934: MDC#setContext method added. [*]
   
    - Implemented Bugzilla 16883: Default ConsoleAppender constructor
  -   enhanced with output sink and layout.
  +   enhanced with output sink and layout. [*]
   
  - - Fixed Bugzilla 12112: CountingQuietWriter miscounts bytes.
  + - Fixed Bugzilla 12112: CountingQuietWriter miscounts bytes. [*]
   
  - - Fixed Bugzilla 18076: setting of firstTime in OnlyOnceErrorHandler.
  + - Fixed Bugzilla 18076: setting of firstTime in OnlyOnceErrorHandler. [*]
   
  - - Fixed Bugzilla 13900: SMTPAppender doesn't use errorHandler when sending 
error occurs.
  + - Fixed Bugzilla 13900: SMTPAppender doesn't use errorHandler when sending 
error occurs. [*]
  +
  + - Implemented Bugzilla 20985: charset support for SMTPAppender [**]
   
    - Implemented Bugzilla 20500: separate registry clearing from doConfigure 
in PropertyConfigurator
  -   to allow to easier extension.
  +   to allow to easier extension. [*]
  +
  + - Fixed Bugzilla 30425: tests used old name for Jetty server class. [*]
   
  - - Fixed Bugzilla 30425: tests used old name for Jetty server class.
  + - Fixed Bugzilla 23912: unsafe access to BoundedFIFO in AsyncAppender. [*]
   
  - - Fixed Bugzilla 23912: unsafe access to BoundedFIFO in AsyncAppender.
   
     November 25, 2004
   
  
  
  
  1.38      +22 -3     
logging-log4j/src/java/org/apache/log4j/net/SMTPAppender.java
  
  Index: SMTPAppender.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/net/SMTPAppender.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- SMTPAppender.java 14 Dec 2004 12:31:10 -0000      1.37
  +++ SMTPAppender.java 14 Dec 2004 18:47:35 -0000      1.38
  @@ -58,10 +58,11 @@
     private String from;
     private String subject;
     private String smtpHost;
  +    private String charset = "ISO-8859-1";
     private int bufferSize = 512;
     private boolean locationInfo = false;
     protected CyclicBuffer cb = new CyclicBuffer(bufferSize);
  -  protected Message msg;
  +  protected MimeMessage msg;
     protected TriggeringEventEvaluator evaluator;
   
     /**
  @@ -104,7 +105,7 @@
         msg.setRecipients(Message.RecipientType.TO, parseAddress(to));
   
         if (subject != null) {
  -        msg.setSubject(subject);
  +        msg.setSubject(subject, charset);
         }
       } catch (MessagingException e) {
         getLogger().error("Could not activate SMTPAppender options.", e);
  @@ -246,7 +247,7 @@
           sbuf.append(t);
         }
   
  -      part.setContent(sbuf.toString(), layout.getContentType());
  +      part.setContent(sbuf.toString(), layout.getContentType() + ";charset=" 
+ charset);
   
         Multipart mp = new MimeMultipart();
         mp.addBodyPart(part);
  @@ -372,6 +373,24 @@
     public boolean getLocationInfo() {
       return locationInfo;
     }
  +
  +    /**
  +     * Set charset for messages: ensure the charset
  +     * you are using is available on your platform.
  +     */
  +    public void setCharset(String charset) {
  +        this.charset = charset;
  +    }
  +
  +    /**
  +     * Returns the charset for messages.  The default
  +     * is "ISO-8859-1."  This method should not return
  +     * null.
  +     */
  +    public String getCharset() {
  +        return charset;
  +     }
  +
   }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to