logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McAninch, Robin J" <mca...@UPMC.EDU>
Subject Configuration problem (locking files)
Date Thu, 01 Feb 2007 18:01:25 GMT
Hi

 

I have been given an application consisting of 5 web projects and 5 back
end objects into which I would like to introduce log4net.  I don't have
a master web.config file (no hierarchy) so I was trying to put the
configuration settings into one xml file on the server and introduce
code into the global asax to configure each project on Application_Start
(.NET 1.1 C#).  The problem I have is the lock on the file from the
first project precludes the others from reading it.  Is there any way
around this short of having a config file for each project?

 

StringBuilder uri = new StringBuilder();

                  

string myURL = string.Empty;

 

//  Get config file path

uri.Append(Server.MapPath("/Config"));

uri.Append("/Files/LogSettings.xml");

 

myURI = uri.ToString();

                  

System.IO.FileStream fs = new
System.IO.FileStream(myURI,System.IO.FileMode.Open,System.IO.FileAccess.
Read,System.IO.FileShare.ReadWrite);

 

log4net.Config.XmlConfigurator.Configure(fs);

                  

log.Debug("Logging started.");

                  

 

Thanks,

Robin


Mime
View raw message