Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 72384 invoked from network); 4 Nov 2005 13:43:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Nov 2005 13:43:28 -0000 Received: (qmail 71681 invoked by uid 500); 4 Nov 2005 13:43:27 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 71631 invoked by uid 500); 4 Nov 2005 13:43:25 -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 71606 invoked by uid 99); 4 Nov 2005 13:43:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2005 05:43:25 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.39.49] (HELO web54111.mail.yahoo.com) (206.190.39.49) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 04 Nov 2005 05:43:20 -0800 Received: (qmail 30690 invoked by uid 60001); 4 Nov 2005 13:43:03 -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=brvZ30oWzzU3t5w7YbPrDvIkOHaD6Y0ykPd8hPUVjWUd8R9gVxBad4bKXB6ZinOBPaz6ot4Hro37ugdJh2hsvJzczAVsL2BdbX0SPOmdWN6AoNHrr50zA74kKhVb5OLcL03qWkNXx9Eh9NFEP0D6tfzJ9izJPyu79+TB/CrumxA= ; Message-ID: <20051104134303.30688.qmail@web54111.mail.yahoo.com> Received: from [70.176.194.78] by web54111.mail.yahoo.com via HTTP; Fri, 04 Nov 2005 05:43:03 PST Date: Fri, 4 Nov 2005 05:43:03 -0800 (PST) From: Shireesh Thanneru Subject: RE: How to get the log level and other config info programmatically To: Log4NET User In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1322774792-1131111783=:30655" 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 --0-1322774792-1131111783=:30655 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thank you! Perhaps, this can be included in the FAQs. How do I contribute to the documentation? Nicko Cadell wrote: To get the level of your logger: ((log4net.Repository.Hierarchy.Logger)logger.Logger).Level to get the level of the logger: ((log4net.Repository.Hierarchy.Logger)log.Logger).Hierarchy.Root.Level Cheers, Nicko > -----Original Message----- > From: Shireesh Thanneru [mailto:thanneru@yahoo.com] > Sent: 04 November 2005 03:35 > To: log4net-user@logging.apache.org > Subject: Re: How to get the log level and other config info > programmatically > > Can some one answer this question? Does Log4Net expose config > information through APIs? > > Shireesh Thanneru wrote: > > How do I get the current log level and other config > info programmatically? The ILogger interface does not define > any methods or properties to do this. > > More specifically, if I have a logger like this: > > private static readonly ILog logger = > LogManager.getLogger(typeof(MyClass)); > > > > How do I find out the log level of this logger (as set > in the config file) and also the log level of the root > logger? logger.IsInfoEnabled, etc. will suffice in most > cases, but how do I find out what is the exact log level that > is specified in the config file? > > > > Thanks, > > > > Shireesh Thanneru > > --0-1322774792-1131111783=:30655 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Thank you! Perhaps, this can be included in the FAQs. How do I contribute to the documentation?

Nicko Cadell <nicko@neoworks.com> wrote:
To get the level of your logger:

((log4net.Repository.Hierarchy.Logger)logger.Logger).Level

to get the level of the logger:

((log4net.Repository.Hierarchy.Logger)log.Logger).Hierarchy.Root.Level

Cheers,
Nicko


> -----Original Message-----
> From: Shireesh Thanneru [mailto:thanneru@yahoo.com]
> Sent: 04 November 2005 03:35
> To: log4net-user@logging.apache.org
> Subject: Re: How to get the log level and other config info
> programmatically
>
> Can some one answer this question? Does Log4Net expose config
> information through APIs?
>
> Shireesh Thanneru wrote:
>
> How do I get the current log level and other config
> info programmatically? The ILogger interface does not define
> any methods or properties to do this.
>
> More specifically, if I have a logger like this:
>
> private static readonly ILog logger =
> LogManager.getLogger(typeof(MyClass));
>
>
>
> How do I find out the log level of this logger (as set
> in the config file) and also the log level of the root
> logger? logger.IsInfoEnabled, etc. will suffice in most
> cases, but how do I find out what is the exact log level that
> is specified in the config file?
>
>
>
> Thanks,
>
>
>
> Shireesh Thanneru
>
>
--0-1322774792-1131111783=:30655--