logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roth Marcel <marcel.r...@softlab.ch>
Subject RE: Log4J SMTP Appender Patternlayout no CR ?
Date Wed, 07 Jan 2004 17:21:18 GMT
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 <a.janssen@videonetworks.com>:

> what pattern are you using?
> 
> -----Original Message-----
> From: Roth Marcel [mailto:marcel.roth@softlab.ch]
> 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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 



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:marcel.roth@softlab.ch
Homepage:  http://www.softlab.ch
_______________________________

---------------------------------------------------------------------
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