logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramaa Davanagere <RDAVA...@mobius.com>
Subject RE: What do I need to do to get rid of this error? Please help
Date Mon, 07 Nov 2005 14:04:58 GMT
 

I'm not sure if this problem is related to the change (setting the
lockingtype to minimalLock) that I just made. I am now seeing too many
duplicate log statements in my log file. This is the first time I'm seeing
this.  Here is the sample of my logs

 

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:17,925 INFO : busTag.clsRetrieveTag.Retrieve() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:18,832 INFO : UILayer.modUICommon.ProcessAction() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

2005-11-07 08:57:19,613 INFO : UILayer.clsUIFlow.ProcessRequest() - Leaving

 

 

Does anybody know how to solve this? Nicko, I did read this article
(http://logging.apache.org/log4net/release/manual/introduction.html#HC-71893
08
<http://logging.apache.org/log4net/release/manual/introduction.html#HC-71893
08> ) but I don't know what to do next.  Why am I seeing this behavior only
now?

 

I feel like I'm in an infinite loop here. One issue is solved, the next one
pops up and the next one and the next.....

 

Appreciate your help.

 

-----Original Message-----
From: Ramaa Davanagere 
Sent: Monday, November 07, 2005 8:15 AM
To: 'Log4NET User'
Subject: RE: What do I need to do to get rid of this error? Please help

 

I figured it out. Here it is.

 

log4net.Appender.RollingFileAppender.LockingModelBase m_lockingType=null;

m_lockingType = new log4net.Appender.RollingFileAppender.MinimalLock();

oRollingFileAppender.LockingModel = m_lockingType;

 

-----Original Message-----
From: Ramaa Davanagere 
Sent: Monday, November 07, 2005 8:07 AM
To: 'Log4NET User'
Subject: RE: What do I need to do to get rid of this error? Please help

 

I have tried

 

log4net.Appender.RollingFileAppender.LockingModelBase m_LockingType =
log4net.Appender.RollingFileAppender.MinimalLock;

oRollingFileAppender.LockingModel = m_LockingType;

 

log4net.Appender.RollingFileAppender.LockingModelBase m_LockingType =
log4net.Appender.RollingFileAppender+MinimalLock;

oRollingFileAppender.LockingModel = m_LockingType;

 

Both of them don't work. Please help me!

 

 

 

-----Original Message-----
From: Ramaa Davanagere 
Sent: Monday, November 07, 2005 7:40 AM
To: 'Log4NET User'
Subject: RE: What do I need to do to get rid of this error? Please help

 

 

How do I write this line in my code? I don't have a config file. 
  
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> 

This line gives me errors. 

log4net.Appender.RollingFileAppender.MinimalLock; 

-----Original Message----- 
From: Nicko Cadell [mailto:nicko@neoworks.com <mailto:nicko@neoworks.com> ] 
Sent: Sunday, November 06, 2005 4:03 PM 
To: Log4NET User 
Subject: RE: What do I need to do to get rid of this error? Please help 

By default the log4net FileAppender takes an exclusive write lock on the 
log file. If you have multiple processes that are logging to the same 
file then you need to use a different locking model. For example the 
MinimalLock model: 

<lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> 

This locking model takes a write lock on the file as each logging event 
written and then releases it immediately. 

An example configuration is: 

<appender name="FileAppender" type="log4net.Appender.FileAppender"> 
  <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> 
  <file value="c:\tmp\test-file.txt" /> 
  <layout type="log4net.Layout.PatternLayout" value="%d [%t] %-5p %c - 
%m%n" /> 
</appender> 

Cheers, 
Nicko 

> -----Original Message----- 
> From: Ramaa Davanagere [mailto:RDAVANAG@mobius.com
<mailto:RDAVANAG@mobius.com> ] 
> Sent: 04 November 2005 17:12 
> To: 'Log4NET User' 
> Subject: RE: What do I need to do to get rid of this error? 
> Please help 
> 
>  
> 
> I wish it was that easy!!!! 
> 
>  
> 
> I have multiple components (20+) using the same log file for 
> logging messages.  I don't think I can check which of the 
> components is currently locking the files, before writing log 
> messages. 
> 
>  
> 
> How do I resolve this? 
> 
>  
> 
> -----Original Message----- 
> From: Shireesh Thanneru [mailto:thanneru@yahoo.com
<mailto:thanneru@yahoo.com> ] 
> Sent: Friday, November 04, 2005 11:55 AM 
> To: Log4NET User 
> Subject: Re: What do I need to do to get rid of this error? 
> Please help 
> 
>  
> 
> You need to make sure that no other process/program is 
> accessing the the file at "C:\Program 
> Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt" 
> 
> so that log4net can acquire a lock on that file. 
> 
> Ramaa Davanagere <RDAVANAG@mobius.com> wrote: 
> 
>        
> 
>        
> 
>       log4net: RollingFileAppender: Searched for existing 
> files in [C:\Program Files\Mobius\contenuity\LogFiles] 
> 
>       log4net: RollingFileAppender: curSizeRollBackups starts at [0] 
> 
>       log4net: FileAppender: Opening file for writing 
> [C:\Program Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt] 
> append [True] 
> 
>       log4net:ERROR [RollingFileAppender] Unable to acquire 
> lock on file C:\Program 
> Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt. The process 
> cannot access the file "C:\Program 
> Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt" because it 
> is being used by another process. 
> 
>       log4net:ERROR [RollingFileAppender] OpenFile(C:\Program 
> Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt,True) call failed. 
> 
>       LockStateException: The file is not currently locked 
> 
>          at log4net.Appender.LockingStream.AssertLocked() 
> 
>          at log4net.Appender.LockingStream.get_CanWrite() 
> 
>          at System.IO.StreamWriter..ctor(Stream stream, 
> Encoding encoding, Int32 bufferSize) 
> 
>          at System.IO.StreamWriter..ctor(Stream stream, 
> Encoding encoding) 
> 
>          at log4net.Appender.FileAppender.OpenFile(String 
> fileName, Boolean append) 
> 
>          at 
> log4net.Appender.RollingFileAppender.OpenFile(String 
> fileName, Boolean append) 
> 
>          at log4net.Appender.FileAppender.SafeOpenFile(String 
> fileName, Boolean append) 
> 
>       log4net: FileAppender: Opening file for writing 
> [C:\Program Files\Mobius\contenuity\LogFiles\vdrconBOLog.txt] 
> append [True] 
> 
> 


Mime
View raw message