Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 410 invoked from network); 8 Nov 2007 13:47:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2007 13:47:31 -0000 Received: (qmail 58687 invoked by uid 500); 8 Nov 2007 13:47:18 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 58659 invoked by uid 500); 8 Nov 2007 13:47:18 -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 58648 invoked by uid 99); 8 Nov 2007 13:47:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 05:47:18 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of proze@ixis-cib.com designates 84.14.112.203 as permitted sender) Received: from [84.14.112.203] (HELO msfeu-c.ixis-cib.com) (84.14.112.203) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 13:47:19 +0000 Received: from msorme.cmi.cdc.fr (unknown [10.9.178.8]) by msfeu-c.ixis-cib.com (SMTP Server) with ESMTP id 51EB4238A for ; Thu, 8 Nov 2007 13:46:58 +0000 (GMT) Received: from msorme.cmi.cdc.fr (localhost [127.0.0.1]) by msorme.cmi.cdc.fr (SMTP Server) with SMTP id 9C3A52952 for ; Thu, 8 Nov 2007 14:46:57 +0100 (MET) Received: from msjacobson.cm.net (unknown [10.9.70.70]) by msorme.cmi.cdc.fr (SMTP Server) with ESMTP id CF2A1967 for ; Thu, 8 Nov 2007 14:46:56 +0100 (MET) Received: from msliege.cm.net ([10.15.37.225]) by msjacobson.cm.net with Microsoft SMTPSVC(6.0.3790.1830); Thu, 8 Nov 2007 14:46:14 +0100 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2663 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8220D.BA900F32" Subject: Problem with the configuration Content-Transfer-Encoding: 7bit Date: Thu, 8 Nov 2007 14:46:13 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with the configuration Thread-Index: AcgiCebBNVyksAE8Qb2N0ZxLhSlsBQAA8POQ Importance: normal Priority: normal From: "Roze, Pascal" To: X-OriginalArrivalTime: 08 Nov 2007 13:46:14.0362 (UTC) FILETIME=[BAC793A0:01C8220D] X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C8220D.BA900F32 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all. =20 This is my first post :-) =20 I have a web site and a Data Object Layer. I'm trying to use log4net in my DAL but I have a problem with the configuration. =20 I want to use an external file named log4net.config in the folder Config/ =20 Here, one class of my DAL: =20 Imports System.Configuration Imports System.Data.Common Imports System.Xml Imports log4net Imports System.Reflection =20 ' Configure logging for this assembly =20 =20 Namespace BPMI Public Class Procedure =20 Private Shared ReadOnly log As log4net.ILog =3D log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMeth od().DeclaringType) =20 Public Sub New() log.Debug("Procedure.New()") ... End Sub =20 End Class =20 ... End Namespace =20 =20 The problem is this one: When I declare the logger, the config file used is Config\log4net.config, as wanted. But in the class constructor, the config file used is the web.config file. =20 =20 Here the internal log4net logs: When I declare the logger: log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [C:\Data\Projets.Net\Intranet\BPMI\BPMISolution\BPMI\Config\log4net.conf ig] watching for file updates =20 In the constructor class: log4net: XmlConfigurator: configuring repository [log4net-default-repository] using .config file section log4net: XmlConfigurator: Application config file is [C:\Data\Projets.Net\Intranet\BPMI\BPMISolution\BPMI\web.config] =20 Why? What don't I understand well? =20 Thanks for your help Cheers =20 Pascal=20 -------------------------------------------------------- Ce message et toutes les pieces jointes peuvent etre confidentiels, et, = de plus, peuvent etre couverts par un privilege ou une protection = legale. Il est etabli a l'intention exclusive de ses destinataires. = Toute utilisation de ce message non conforme a sa destination, toute = diffusion ou toute publication, totale ou partielle, est interdite, sauf = autorisation expresse prealable. Toutes opinions exprimees dans ce = message, sont personnelles a leur auteur et ne sauraient necessairement = refleter celle de IXIS Corporate & Investment Bank, de ses filiales ou = de sa maison mere. Elles sont aussi susceptibles de modification sans = notification prealable. Tous droits reserves. Si vous recevez ce message = par erreur, merci de le detruire et d'en avertir immediatement = l'expediteur. Toute communication avec IXIS Corporate & Investment Bank = peut etre controlee, enregistree et conservee. IXIS Corporate & = Investment Bank decline toute responsabilite au titre de ce message s'il = a ete altere, deforme ou falsifie. Les communications sur Internet = n'etant pas securisees, IXIS Corporate & Investment Bank informe qu'il = ne peut accepter aucune responsabilite quant au contenu de ce message. =20 This email and any attachment may be confidential and may also be = legally privileged or otherwise protected from disclosure. It is = intended only for the stated addressee(s) and access to it by any other = person(s) is unauthorised. Any use, dissemination or disclosure not in = accordance with its purpose, either in whole or in part, is prohibited = without our prior formal approval. Any opinion expressed in this message = may be personal to the author and may not necessarily reflect the = opinion of IXIS Corporate & Investment Bank, its affiliates or parent = company. It may also be subject to change without prior notice. = Copyright reserved. If you are not an addressee, you must not disclose, = copy, circulate or in any other way use or rely on the information = contained in this email. If you have received it in error, please inform = us immediately and delete all copies. Any communication made with IXIS = Corporate & Investment Bank (whether personal or business) may be = monitored and a record kept. IXIS Corporate & Investment Bank shall not = be liable for the message if altered, changed or falsified. As = communication on the Internet is not secure, IXIS Corporate & Investment = Bank does not accept responsibility for the content of this message. = -------------------------------------------------------- ------_=_NextPart_001_01C8220D.BA900F32 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all.

 

This is my first post J

 

I have a web site and a Data Object = Layer.

I’m trying to use log4net in my DAL but = I have a problem with the configuration.

 

I want to use an external file named = log4net.config in the folder Config/

 

Here, one class of my = DAL:

 

Imports System.Configuration

Imports System.Data.Common

Imports = System.Xml

Imports = log4net

Imports System.Reflection

 

' Configure logging for this = assembly

<Assembly: log4net.Config.XmlConfigurator(ConfigFile:=3D"Config\log4net.config", = Watch:=3DTrue)> =

 

Namespace = BPMI

Public Class = Procedure

 

        Private = Shared ReadOnly log As log4net.ILog =3D log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMetho= d().DeclaringType)

 

        Public Sub New()

            log.Debug("Procedure.New()")

        End Sub

 

End Class

 

End = Namespace

 

 

The problem is this = one:

When I = declare the logger, the config file used is Config\log4net.config, as = wanted.

But in = the class constructor, the config file used is the web.config = file.

 

 

Here = the internal log4net logs:

When I = declare the logger:

log4net: XmlConfigurator: configuring = repository [log4net-default-repository] using file [C:\Data\Projets.Net\Intranet\BPMI\BPMISolution\BPMI\Config\log4net.confi= g] watching for file updates

 

In the constructor class:

log4net: XmlConfigurator: configuring = repository [log4net-default-repository] using .config file = section

log4net: XmlConfigurator: Application = config file is = [C:\Data\Projets.Net\Intranet\BPMI\BPMISolution\BPMI\web.config]

 

Why?

What don’t I understand well?

 

Thanks for your = help

Cheers

 

Pascal


Ce message et toutes les pièces jointes peuvent = être confidentiels, et, de plus, peuvent être couverts par un = privilège ou une protection légale. Il est établi à = l’intention exclusive de ses destinataires. Toute utilisation de = ce message non conforme à sa destination, toute diffusion ou toute = publication, totale ou partielle, est interdite, sauf autorisation = expresse préalable. Toutes opinions exprimées dans ce message, = sont personnelles à leur auteur et ne sauraient nécessairement = refléter celle de IXIS Corporate & Investment Bank, de ses = filiales ou de sa maison mère. Elles sont aussi susceptibles de = modification sans notification préalable. Tous droits = réservés. Si vous recevez ce message par erreur, merci de le = détruire et d’en avertir immédiatement = l’expéditeur. Toute communication avec IXIS Corporate & = Investment Bank peut être contrôlée, enregistrée et = conservée. IXIS Corporate & Investment Bank décline toute = responsabilité au titre de ce message s’il a été = altéré, déformé ou falsifié. Les communications = sur Internet n'étant pas sécurisées, IXIS Corporate & = Investment Bank informe qu'il ne peut accepter aucune = responsabilité quant au contenu de ce message.
 

This email and any attachment may be confidential = and may also be legally privileged or otherwise protected from = disclosure. It is intended only for the stated addressee(s) and access = to it by any other person(s) is unauthorised. Any use, dissemination or = disclosure not in accordance with its purpose, either in whole or in = part, is prohibited without our prior formal approval. Any opinion = expressed in this message may be personal to the author and may not = necessarily reflect the opinion of IXIS Corporate & Investment Bank, = its affiliates or parent company. It may also be subject to change = without prior notice. Copyright reserved. If you are not an addressee, = you must not disclose, copy, circulate or in any other way use or rely = on the information contained in this email. If you have received it in = error, please inform us immediately and delete all copies. Any = communication made with IXIS Corporate & Investment Bank (whether = personal or business) may be monitored and a record kept. IXIS Corporate = & Investment Bank shall not be liable for the message if altered, = changed or falsified. As communication on the Internet is not secure, = IXIS Corporate & Investment Bank does not accept responsibility for = the content of this message. =20


------_=_NextPart_001_01C8220D.BA900F32--