Apache log4net: How to set CC and BCC addresses to SmtpAppender from config file

I've been trying to add cc and bcc addresses to log4net's SmtpAppender but I'm getting no flair:

<appender name="Mail" type="log4net.Appender.SmtpAppender"> <to value="[email protected]" /> <cc value="[email protected]" /> <bcc value="[email protected]" /> <from value="[email protected]" /> <subject value="Some pearls of wisdom for you" /> <smtpHost value="localhost" /> <bufferSize value="4096" /> <lossy value="false" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%newline%date [%-4level]%message" /> </layout> </appender>

I'm currently using log4net version 1.2.10.0, if anyone could help me out I'd be very glad.

--------------Solutions-------------

According to this documentation, there is no cc and bcc fields in the SMTP appender.

You can use a semicolon-separated list for the To attribute (which would be almost equivalent to cc). But no solution for bcc.

You could create a class deriving from SmtpAppender, which adds these properties.

There is no bcc or cc, but you can use multiple 'to' addresses.

You actually need to use commas as separators most of the time. For .Net later than 1.1 you need commas, before you need semicolons.

Category:.net Time:2010-09-28 Views:1

Related post

  • Apache: I want to enable SSI. Can anyone furnish an example config file? 2009-10-23

    Yes - Google abounds with information about configuring Apache to support SSI. But unfortunately, I still cannot seem to get it right. My questions: Can anyone furnish me a full-fledged example config file that enables SSI on an Apache server? Also c

  • How can I tell where log4net thinks it's getting its config file from? 2010-05-04

    I have the following log from the log4net debug log: log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy] log4net: XmlConfigurator: configuring repo

  • Can you pull the connectionString for a log4net AdoNetAppender from elsewhere in a web.config file? 2010-03-14

    Hey all. This is my first StackOverflow question. I'm already have a db connection string in my web.config file. I scanned the log4net docs, but can't seem to find a way to use it within the log4net section of my web.config file. Is is possible to do

  • Best practice to include log4Net external config file in ASP.NET 2009-11-13

    I have seen at least two ways to include an external log4net config file in an ASP.NET web application: Having the following attribute in your AssemblyInfo.cs file: [assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log.config", Watch = true)] C

  • log4net.config file loading when using asp.net development server 2009-11-25

    So, I have log4net configuration in log4net.config file and I don't want to include it in the web.config. I initialize configuration in Application_Start like this log4net.Util.LogLog.InternalDebugging = true; log4net.Config.XmlConfigurator.Configure

  • How do I control WCF logging from a log4net config file? 2009-12-17

    We do all our logging with log4net, our support staff etc know how to edit the log4net config files. We are now making use of WCF in our apps. Therefore how can I enable the WCF built in logging to be controlled from the log4net config file, so that

  • Serving two websites with Apache with single domain name and single IP address 2010-02-09

    I am trying to host two websites using Apache from the same Ubuntu server. I have one ip address, and I only have one domain (which resolves to the ip address). So I want requests to the domain name to give one website, and requests to the ip address

  • Is it possible to easily modify the log4net section in the config file of several running applications remotely? 2010-04-28

    Dear ladies and sirs. Our product consists of client, server and agents. Each deployed on different machines. The QA is having a hard time to manipulate the log4net sections in the respective config files. Right now, they have to have remote desktops

  • Storing and accessing a log4net config file via SQL 2010-07-19

    A co-worker had told me that he thought it was possible to store/access log4net's config file in a database rather than a standard config file. If it's possible, how would you go about doing this? Google search seems to be failing me. --------------S

  • How to get WinForms app to find a log4net config file when running from the IDE? 2010-08-14

    I'm using log4net with a VisualStudio WinForms app, and I need log4net to find its config file. (I must keep the config settings in a separate file.) It works if the config file is in the directory with the executable, but how do I get it there? For

  • Encryption of log4net in config file 2010-08-23

    I am trying to encrypt sections of the application configuration file (app.exe.config) for security purposes. I succeeded in encryption the appSettings and connectionStrings. However, I get the following error when I try to encrypt the log4net part:

  • log4net set from an external config file not working 2011-06-22

    I'm having a weird issue with log4net. In an ASP.NET application, I want to configure log4net externally, so I have a separate log4net.config file which I hook up to my web app with this line in the AssemblyInfo.cs file belonging to my web app: [asse

  • Test Apache config file from Python 2011-08-31

    How would I go about testing the apache config file from python? I've trying using the "os.popen" with "text = stdout_handle.read() to get the result, but nothing happens. Any help would be great :) --------------Solutions------------- I'm guessing y

  • Setting up Log4Net appender in another file than the main config file 2011-10-28

    I want to put an appender section in another file than my main log4net config file. The goal is to allow me to publish my application with a log4net.config but not erase some customers specific information like smtp parameters. THe idea is to have :

  • Get To/CC/BCC addresses from a MimeMessage? 2012-01-05

    I need to get the To/CC/BCC addresses from a JavaMail MimeMessage object. It seems that the only way I can do this is through getRecepients, but then I can't tell who's in the To field vs the CC and BCC fields. Is there a way to do this? ------------

  • Custom errors in apache config files (not error pages) 2012-01-15

    I'm not looking to create custom error pages, but to actually issue error messages when the config file is parsed. Specifically, I want to use an <IfModule> to throw up an error if the module hasn't been loaded, so it's easier to debug. -------

  • Can I use one Log4Net config file for multiple (related) solutions? 2012-02-16

    I have executable projects A and B in solutions sA and sB. Both of these solutions reference projects C, D, etc... as they are similar in functionality and so share a lot of common code. I've happily implemented Log4Net into sA by keeping the dll and

  • Email not go to BCC address 2012-05-03

    i have set a BCC address like this but it does not go out Contact con1 = new Contact(); con1.FirstName = 'Anil'; con1.LastName = 'Dutt'; con1.Email = '[email protected]'; insert con1; Messaging.SingleEmailMessage mail1 = new Messaging.SingleEmailMessage

  • When sending group emails, why are none of the bcc addresses I list receiving my mails? 2012-02-02

    I have been switched from hotmail to outlook. It took me over 6 hours to work out how to send group emails to bcc addresses and to send a single email to my group. The new system for bccs is far slower than in hotmail, it took a further 2 hours to se

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.508 (s). 13 q(s)