logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Log4J SMTP Appender Patternlayout no CR ?
Date Wed, 07 Jan 2004 18:41:09 GMT

Try "%d{yyyy-MM-dd HH:mm:ss} %-5p (%F:%L) - %m\r\n" regardless of OS.

SMTP assumes lines are ended with CRLF.

At 06:21 PM 1/7/2004 +0100, Roth Marcel wrote:
>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

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



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


Mime
View raw message