logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petite Escalope <miniscal...@gmail.com>
Subject Re: Customized mail subject fo SmtpAppender
Date Wed, 09 Dec 2009 10:16:03 GMT
Thank you :)

2009/12/8 Pascal ROZE <pascal.roze@gmail.com>

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


-- 
Cordialement

Alexandre Codjovi
06 59 08 39 82
alexandre@codjovi.fr

Mime
View raw message