Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 34910 invoked from network); 16 Aug 2005 20:32:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2005 20:32:02 -0000 Received: (qmail 58430 invoked by uid 500); 16 Aug 2005 20:32:02 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 58399 invoked by uid 500); 16 Aug 2005 20:32:01 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 58386 invoked by uid 99); 16 Aug 2005 20:32:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2005 13:32:01 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.207.146] (HELO web32215.mail.mud.yahoo.com) (68.142.207.146) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 16 Aug 2005 13:32:20 -0700 Received: (qmail 42225 invoked by uid 60001); 16 Aug 2005 20:31:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=WrDyMsO2E/k3QK2mbBLAAxLgyHLK6BN5PulOisQ+2qj55bS9mudHnuLWdEpPGrtsvnQPUZeNwg1XB/z/KZNQkAr3kQ8G70uP9r+Idj2gA96qModfIGGj17s2VOszeg0TaoNxhT6B4ZbT4qLDdeT+0L6RgOrfzygV6Eqp5DrJHlI= ; Message-ID: <20050816203159.42223.qmail@web32215.mail.mud.yahoo.com> Received: from [68.253.108.230] by web32215.mail.mud.yahoo.com via HTTP; Tue, 16 Aug 2005 13:31:59 PDT Date: Tue, 16 Aug 2005 13:31:59 -0700 (PDT) From: Ron Grabowski Subject: Re: Cannot switch between logging levels To: Log4NET User In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If you enable debugging inside of log4net: and use ConfigureAndWatch to configure log4net, you should see a message similiar to this when you make a change to your log4net.config file. The text below was generated when I changed the level of my root logger from ALL to OFF: log4net: ConfigureAndWatchHandler: Changed [c:\inetpub\wwwroot\log4net.config] log4net: ConfigureAndWatchHandler: Changed [c:\inetpub\wwwroot\log4net.config] log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [c:/inetpub/wwwroot/log4net.config] log4net: XmlConfigurator: configuring repository [log4net-default-repository] using stream log4net: XmlConfigurator: loading XML configuration log4net: XmlConfigurator: Configuring Repository [log4net-default-repository] log4net: XmlHierarchyConfigurator: Configuration update mode [Merge]. log4net: XmlHierarchyConfigurator: Logger [root] Level string is [OFF]. log4net: XmlHierarchyConfigurator: Logger [root] level set to [name="OFF",value=2147483647]. ... It looks like you're configuring log4net twice. A better approach may be to use your own AdoNetAppender: public class MyAdoNetAppender : AdoNetAppender { protected string ConnectionString { get { return base.ConnectionString; } set { base.ConnectionString = ConfigurationSettings.AppSettings["Logger.ConnectionString"]; } } } Your call to configure log4net will look something like this: FileInfo log4netConfig = GetLog4netConfigFile(); log4net.Config.DOMConfigurator.ConfigureAndWatch(log4netConfig); --- Jason Goldsmith wrote: > Hi, I have an ASP.Net application and I store many Session variables, > so > I've created a separate config file for log4net (log4net.config) > because > if any change is made to the web.config file all my Session variables > are blown away. I have configured it with the following: