Hi,
I'm using the following pattern:
%d{yyyy-MM-dd HH:mm:ss} %-5p (%F:%L) - %m%n
Code looks like:
String m_Pattern = "%d{yyyy-MM-dd HH:mm:ss} %-5p (%F:%L) - %m%n";
PatternLayout m_PLayout = null;
m_PLayout = new PatternLayout(m_Pattern);
SMTPAppender m_SMTP = new SMTPAppender();
m_SMTP.setSMTPHost("SMTP_HOST");
m_SMTP.setFrom("SMTP_FROM");
m_SMTP.setTo("SMTP_TO");
m_SMTP.setSubject("SMTP-Message: ");
m_SMTP.setLayout(m_PLayout);
m_SMTP.setBufferSize(2048);
...
I've tried already a workaround with adding a "\n" Newline at the end of the
pattern and that works fine then for the SMTP-Appender, but then I cannot use
this PatternLayout for the file appender ...
what you think ?
cheers,
Marcel
Zitiere Adrian Janssen <[EMAIL PROTECTED]>:
> what pattern are you using?
>
> -----Original Message-----
> From: Roth Marcel [mailto:[EMAIL PROTECTED]
> Sent: 07 January 2004 16:26
> To: 'Log4J Users List'
> Subject: Log4J SMTP Appender Patternlayout no CR ?
>
>
> Hello everybody,
>
> I'm using the Log4J SMTP Appender, but the Email created in case of an
> error
> contains the Log-Statements without a Carriage-Return at the end of a
> Line.
> That makes the email quite unreadable ...
>
> Is this normal behaviour of an SMTP Appender,
> or is there anything I could do about that ?
>
> In the normal File/Console Appender I get readable statements with CR at
> the
> end.
>
> Any infos appreciated ...
>
> Regards,
> Marcel Roth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
Marcel Roth
Technology Consultant
Enterprise CRM
_______________________________
Softlab AG
Kanalstrasse 31
CH-8152 Glattbrugg
Switzerland
Telefon +41 1 809 41 57
Telefax +41 1 809 41 42
Mobile +41 76 420 02 07
E-Mail mailto:[EMAIL PROTECTED]
Homepage: http://www.softlab.ch
_______________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]