You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Steve Mactaggart <sm...@1300ttimes.com> on 2003/01/08 00:04:12 UTC

SMTPAppender Exception printing

Hi,

I was looking for a fix to a bug with the SMTPAppender when it prints the
stack trace a few day ago.  Since then I have had no reply about whether it
has been found or not and so proceeded to create a sub-class of the Appender
to fix the problem.

The fix was achieved by overriding one of the SMTPAppenders methods, the
sendBuffer() method.

And changed the code from

                        for (int j = 0; j < s.length; j++)
                        {
                            sbuf.append(s[j]);
                        }
to
                        for (int j = 0; j < s.length; j++)
                        {
                            sbuf.append(s[j]);
                            sbuf.append('\n');
                        }

Im not sure if this is the best way to solve the problem, but works for my
situation. If there is a better or more logj4 way of doing this can you let
me know.  This is my first change to the log4j code and havn't read a lot of
it.

I was hoping to find out if this has already been fixed somewhere, or is
planned to be. Also if it is not, how would I go about logging this as a
bug.

Thanks for your time

--------------------------------
Steve Mactaggart
Systems Architect

1300Ttimes
BH    +61 (03) 9620 7477
FAX   +61 (03) 9620 7377
EMAIL smactaggart@1300Ttimes.com
WEB   www.1300Ttimes.com
--------------------------------




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: SMTPAppender Exception printing

Posted by Ceki Gülcü <ce...@qos.ch>.
Steve,

Could you please fill in a bug report? Thanks in advance,

At 10:54 08.01.2003 +1100, you wrote:
>Ceki,
>
>It happens on both our developers machines which are win2000, and our
>production environments which are linux redhat boxes.
>
>It is running on code associated to a tomcat servlet application using the
>1.3.1_01 jdk.
>
>The config for the layout format was:
>log4j.appender.errormail.layout=org.apache.log4j.PatternLayout
>log4j.appender.errormail.layout.ConversionPattern=%d{dd MMM yy
>H:mm:ss}:%t:%-20.20c{1}:%-5.5p : %m%n
>
>Hope that helps.
>
>Steve

--
Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: SMTPAppender Exception printing

Posted by Steve Mactaggart <sm...@1300ttimes.com>.
Ceki,

It happens on both our developers machines which are win2000, and our
production environments which are linux redhat boxes.

It is running on code associated to a tomcat servlet application using the
1.3.1_01 jdk.

The config for the layout format was:
log4j.appender.errormail.layout=org.apache.log4j.PatternLayout
log4j.appender.errormail.layout.ConversionPattern=%d{dd MMM yy
H:mm:ss}:%t:%-20.20c{1}:%-5.5p : %m%n

Hope that helps.

Steve

-----Original Message-----
From: Ceki Gulcu [mailto:ceki@qos.ch]
Sent: Wednesday, January 08, 2003 10:14 AM
To: Log4J Developers List
Subject: Re: SMTPAppender Exception printing



Hi Steve,

Interesting... Which environment is this? which OS? which JDK?
What is your layout format?

Thanks for the report and the fix by the way!

At 10:04 08.01.2003 +1100, you wrote:
>Hi,
>
>I was looking for a fix to a bug with the SMTPAppender when it prints the
>stack trace a few day ago.  Since then I have had no reply about whether it
>has been found or not and so proceeded to create a sub-class of the
Appender
>to fix the problem.
>
>The fix was achieved by overriding one of the SMTPAppenders methods, the
>sendBuffer() method.
>
>And changed the code from
>
>                         for (int j = 0; j < s.length; j++)
>                         {
>                             sbuf.append(s[j]);
>                         }
>to
>                         for (int j = 0; j < s.length; j++)
>                         {
>                             sbuf.append(s[j]);
>                             sbuf.append('\n');
>                         }
>
>Im not sure if this is the best way to solve the problem, but works for my
>situation. If there is a better or more logj4 way of doing this can you let
>me know.  This is my first change to the log4j code and havn't read a lot
of
>it.
>
>I was hoping to find out if this has already been fixed somewhere, or is
>planned to be. Also if it is not, how would I go about logging this as a
>bug.
>
>Thanks for your time
>
>--------------------------------
>Steve Mactaggart
>Systems Architect
>
>1300Ttimes
>BH    +61 (03) 9620 7477
>FAX   +61 (03) 9620 7377
>EMAIL smactaggart@1300Ttimes.com
>WEB   www.1300Ttimes.com
>--------------------------------
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SMTPAppender Exception printing

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi Steve,

Interesting... Which environment is this? which OS? which JDK?
What is your layout format?

Thanks for the report and the fix by the way!

At 10:04 08.01.2003 +1100, you wrote:
>Hi,
>
>I was looking for a fix to a bug with the SMTPAppender when it prints the
>stack trace a few day ago.  Since then I have had no reply about whether it
>has been found or not and so proceeded to create a sub-class of the Appender
>to fix the problem.
>
>The fix was achieved by overriding one of the SMTPAppenders methods, the
>sendBuffer() method.
>
>And changed the code from
>
>                         for (int j = 0; j < s.length; j++)
>                         {
>                             sbuf.append(s[j]);
>                         }
>to
>                         for (int j = 0; j < s.length; j++)
>                         {
>                             sbuf.append(s[j]);
>                             sbuf.append('\n');
>                         }
>
>Im not sure if this is the best way to solve the problem, but works for my
>situation. If there is a better or more logj4 way of doing this can you let
>me know.  This is my first change to the log4j code and havn't read a lot of
>it.
>
>I was hoping to find out if this has already been fixed somewhere, or is
>planned to be. Also if it is not, how would I go about logging this as a
>bug.
>
>Thanks for your time
>
>--------------------------------
>Steve Mactaggart
>Systems Architect
>
>1300Ttimes
>BH    +61 (03) 9620 7477
>FAX   +61 (03) 9620 7377
>EMAIL smactaggart@1300Ttimes.com
>WEB   www.1300Ttimes.com
>--------------------------------
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>