logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Log4Net XmlConfigurator Watch
Date Thu, 21 Jul 2005 19:23:20 GMT
The configure and watch functionality should work fine from a windows
service. It does depend on the file system raising a file change event
when you modify the file.

If any error messages are being generated you will need to enable
log4net internal debug to see them.
http://logging.apache.org/log4net/release/faq.html#internalDebug

Nicko

> -----Original Message-----
> From: Stewart, Mark (GE Consumer Finance, consultant) 
> [mailto:mstewart@wmcdirect.com] 
> Sent: 19 July 2005 22:26
> To: Log4NET User
> Subject: Log4Net XmlConfigurator Watch
> 
> I am using VS.NET 2003, and log4net (1.2.0 Beta 9).
> 
> I built a simple Windows test application and placed the 
> required attributes in the assemblyInfo file.
> 
> 	...
> 	[assembly: AssemblyTrademark("")]
> 	[assembly: AssemblyCulture("")]		
> 	[assembly: log4net.Config.XmlConfigurator(Watch=true)]
> 
> This worked fine in detecting configuration changes while the 
> application was running.
> 
> However, when I did the same thing with a Windows Service 
> application, there is no run-time detection.  I have to 
> restart the service to activate log4net changes.
> 
> Any ideas? Should this work with a Windows Service?
> 
> 
> Thanks,
> Mark Stewart
> mstewart@wmcdirect.com
> 
> 
> 
> 
> -----Original Message-----
> From: Nicko Cadell [mailto:nicko@neoworks.com]
> Sent: Monday, July 18, 2005 12:38 PM
> To: Log4NET User
> Subject: RE: Log4Net Threading Error?
> 
> 
> I think this is coming from a Console.Out.WriteLine call. As 
> far as I am aware this should be thread safe, indeed looking 
> at the exception stack it looks like Console.Out is a 
> SyncTextWriter. My first guess is that this is a thread 
> safety issue in the .NET core library :(
> 
> However log4net should not be chucking out this sort of 
> exception. This was fixed as part of 
> http://issues.apache.org/jira/browse/LOG4NET-26 and will be 
> part of the next release.
> 
> Out of interest is there a good reason that you are calling 
> DOMConfigurator.Configure from WMService.Data.Oracle..ctor? 
> If possible you should try to minimise the number of times 
> you call DOMConfigurator.Configure. You should try to do it 
> once at start-up rather during execution.
> 
> Cheers,
> Nicko
> 
> > -----Original Message-----
> > From: Stewart, Mark (GE Consumer Finance, consultant) 
> > [mailto:mstewart@wmcdirect.com]
> > Sent: 06 July 2005 22:06
> > To: Log4NET User
> > Subject: Log4Net Threading Error?
> > 
> > I have gotten the following error in my log4net log.  This 
> application 
> > can have multiple threads writing to the same log file.  
> The Message 
> > and the trace stack below point to log4net...
> > Any comments or ideas?
> > (Using = VS.NET 2003, and log4net (1.2.0 Beta 9)
> > 
> > 
> > 2005-05-12 17:53:43,863 [1420] FATAL
> > WMService.Control.Process [] -
> > WMService.Service.ReceiveMessage() had an Exception
> > Exception: System.IndexOutOfRangeException
> > Message: Probable I/O race condition detected while copying 
> memory.  
> > The I/O package is not thread safe by default.  In multithreaded 
> > applications, a stream must be accessed in a thread-safe 
> way, such as 
> > a thread-safe wrapper returned by TextReader's or TextWriter's 
> > Synchronized methods.  This also applies to classes like 
> StreamWriter 
> > and StreamReader.
> > Source: mscorlib
> >    at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffset, 
> > Array dst, Int32 dstOffset, Int32 count)
> >    at System.IO.StreamWriter.Write(Char[] buffer, Int32 
> index, Int32 
> > count)
> >    at System.IO.TextWriter.WriteLine(String value)
> >    at System.IO.SyncTextWriter.WriteLine(String value)
> >    at log4net.helpers.LogLog.Debug(String msg)
> >    at
> > log4net.Config.DOMConfigurator.Configure(ILoggerRepository 
> repository)
> >    at log4net.Config.DOMConfigurator.Configure()
> >    at WMService.Data.Oracle..ctor()
> >    at WMService.Control.Process.ReceiveMessage(MessageQueue
> > messageQueue)
> > 
> > 
> > Thanks,
> > Mark
> >
> 

Mime
View raw message