Return-Path: Delivered-To: apmail-logging-log4net-dev-archive@www.apache.org Received: (qmail 5789 invoked from network); 14 Jun 2008 15:37:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jun 2008 15:37:54 -0000 Received: (qmail 72839 invoked by uid 500); 14 Jun 2008 15:37:55 -0000 Delivered-To: apmail-logging-log4net-dev-archive@logging.apache.org Received: (qmail 72798 invoked by uid 500); 14 Jun 2008 15:37:54 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 72787 invoked by uid 99); 14 Jun 2008 15:37:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jun 2008 08:37:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.142.200.115] (HELO web30502.mail.mud.yahoo.com) (68.142.200.115) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 14 Jun 2008 15:37:04 +0000 Received: (qmail 19624 invoked by uid 60001); 14 Jun 2008 15:37:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=xUwSM+YO+Q+KP0tUSY2FhGJTIL6NTuWNWqKnIlNXqS0ZJnaJ61L1yu46Pj+pyGVh0sWDddze7mx7Mw/C7aFtKzWPGhLVkEuhbR9FJhWRVGn3RUquT9/uybDMGvaTLIJhWGCabr52jNrWFqj7FuE+FK1xbRLOoRB0YulfFX4F15s=; Received: from [75.179.188.181] by web30502.mail.mud.yahoo.com via HTTP; Sat, 14 Jun 2008 08:37:21 PDT X-Mailer: YahooMailRC/975.45 YahooMailWebService/0.7.199 Date: Sat, 14 Jun 2008 08:37:21 -0700 (PDT) From: Ron Grabowski Subject: Re: Log4Net Appender To: Log4NET Dev MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <261156.84777.qm@web30502.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org By "each class that is loaded" do you mean each instance of the class needs to write to its own company database? CompanyService companyService = new CompanyService("AlphaCompany"); CompanyService companyService = new CompanyService("BetaCompany"); CompanyService companyService = new CompanyService("GammaCompany"); If that's the case you could extend ILog and add methods that accept an identifer which would be used as the database table: public class CompanyService { private readonly static DatabaseLog log = new DatabaseLog(LogManager.GetLogger(typeof(CompanyService))); private string companyName; public CompanyService(string companyName) { this.companyName = companyName; } private int CalculateSomething() { log.Debug(companyName, "Starting to calculate something"); } } And/or you could create a custom AdoNetAppender that looks for a special MDC value and understands what database table to map that to: ----- Original Message ---- From: Scott Carr To: log4net-dev@logging.apache.org Sent: Wednesday, June 4, 2008 1:14:26 PM Subject: Log4Net Appender I am using a static logger at the top of my class, and it is working fine. Now I need to create an Appender that goes to a specific Company db. This changes for each class that is loaded, though. Is there a way to use the static logger in this fashion, where I can change the specific instance for the Class Logger? What would be the best way to implement this? Should this go on the users list instead? Thanks