Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 3735 invoked from network); 5 Feb 2008 13:09:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Feb 2008 13:09:42 -0000 Received: (qmail 19023 invoked by uid 500); 5 Feb 2008 13:09:34 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 18998 invoked by uid 500); 5 Feb 2008 13:09:34 -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 18986 invoked by uid 99); 5 Feb 2008 13:09:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2008 05:09:33 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [217.112.162.197] (HELO main.hasam.cz) (217.112.162.197) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2008 13:09:04 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: RE: Log4Net used into Class library Date: Tue, 5 Feb 2008 14:09:08 +0100 Message-ID: <79283A4C79821448A6B7E973A173361F2FE64C@main.hasam.cz> In-Reply-To: <15289024.post@talk.nabble.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Log4Net used into Class library thread-index: Achn8ZoeaoUlLGa9TjSKZ9x955YViAABcX5A References: <15289024.post@talk.nabble.com> From: "Radovan Raszka" To: "Log4NET User" X-Virus-Checked: Checked by ClamAV on apache.org You must configure logging system first: log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("mypath/to/log4net.xml")); // after configuring you can get logger instance logger =3D log4net.LogManager.GetLogger(typeof(OnCloseSessionManager)) If you can not configure log4net using XmlConfiguratorAtttribute, check if config file is on the expected path (in the same directory as your assembly) R -----Original Message----- From: jeusdi [mailto:cabrejcr@terra.es]=20 Sent: Tuesday, February 05, 2008 1:21 PM To: log4net-user@logging.apache.org Subject: Log4Net used into Class library I'm develping a little library, and I'm adding log features to it, now. The problem is that I don't know How I Can configure Log4Net. In my code I obtain a logger as: private log4net.ILog logger =3D log4net.LogManager.GetLogger(typeof(OnCloseSessionManager)) but, when I need to use it (the logger), it is null. I also have this line in my code: [assembly: log4net.Config.XmlConfigurator(ConfigFile=3D"log4net.xml", Watch=3Dtrue)] but, the logger is null, yet. The beliee that this line find around the application directory files as log4net.xml and configure the logs using this xml file... The log4net.xml file of my application (application that uses my class library) is: Can you help me please? I will appreciate a lot your help. Thanks for all. -- View this message in context: http://www.nabble.com/Log4Net-used-into-Class-library-tp15289024p1528902 4.html Sent from the Log4net - Users mailing list archive at Nabble.com.