logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal ROZE <pascal.r...@gmail.com>
Subject Re: Customized mail subject fo SmtpAppender
Date Tue, 08 Dec 2009 08:42:51 GMT
Hi

Look at this: http://www.codeproject.com/KB/cs/log4net_SmtpAppender.aspx

Cheers

2009/12/7 Petite Escalope <miniscalope@gmail.com>

> Hello,
> I am using log4net for a web project and would like to make customized mail
> subjects my email appender. I already tried something like :
>
> *          <subject type="log4net.Util.PatternString" value="CovCake LOG
> INFO : %property{mailsubject}" />*
>
> * public static void MailInfo(string msg, string subjectDetails)*
>
> *            {*
> *                log4net.ThreadContext.Properties["mailsubject"] =
> subjectDetails;*
> *                Log.Mail.Info(msg);*
> *                log4net.ThreadContext.Properties.Clear();*
> *            }*
> *
> *
> But it renders CovCake LOG INFO : (null).
> *
> *
> Is there a way to customize mail subject natively (i mean without
> overriding existing classes or extending the SmtpAppender)?
> *
> *
> *T*hank you very much. Sorry for my english.
>
> Best *regards*
>
>
>

Mime
View raw message