Hi all.
This is my first post :-)
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:="Config\log4net.config",
Watch:=True)>
Namespace BPMI
Public Class Procedure
Private Shared ReadOnly log As log4net.ILog =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMeth
od().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.conf
ig] 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 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.
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. --------------------------------------------------------