Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 25214 invoked from network); 22 Nov 2010 15:16:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Nov 2010 15:16:16 -0000 Received: (qmail 23406 invoked by uid 500); 22 Nov 2010 15:16:47 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 23326 invoked by uid 500); 22 Nov 2010 15:16:45 -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 23318 invoked by uid 99); 22 Nov 2010 15:16:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Nov 2010 15:16:44 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [121.241.21.134] (HELO datamatics.com) (121.241.21.134) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Nov 2010 15:16:34 +0000 Received: (qmail 21906 invoked by uid 65205); 22 Nov 2010 15:08:33 -0000 Received: from 172.1.2.78 by Qmailnew (envelope-from , uid 0) with qmail-scanner-1.25 (clamscan: 0.60. Clear:RC:0(172.1.2.78):SA:0(-99.7/5.0):. Processed in 0.354315 secs); 22 Nov 2010 15:08:33 -0000 X-Envelope-From: vikas.manghani@datamatics.com Received: from unknown (HELO KCTES1) (vikas.manghani@datamatics.com@[172.1.2.78])(envelope-sender )by 0 (qmail-ldap-1.03) with SMTPfor ; 22 Nov 2010 15:08:33 -0000 Message-ID: <011701cb8a58$2dd378e0$fa96fea9@KCTES1> Reply-To: "vikas manghani" From: "vikas manghani" To: "Log4NET User" References: <00bb01cb8a47$13a8ece0$fa96fea9@KCTES1> <005201cb8a4d$c8f586c0$5ae09440$@org> Subject: Re: Error while starting second instance of application Date: Mon, 22 Nov 2010 20:46:03 +0530 Organization: dgsl MIME-Version: 1.0 Content-Type: multipart/alternative;boundary="----=_NextPart_000_0114_01CB8A86.476F0520" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on Qmailnew X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-99.7 required=5.0 tests=AWL,HTML_70_80,HTML_MESSAGE,USER_IN_WHITELIST autolearn=disabled version=3.0.1 This is a multi-part message in MIME format. ------=_NextPart_000_0114_01CB8A86.476F0520 Content-Type: text/plain;charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Robert Thanks, but the logging mechanism of our application is based on a = wrapper over the core log4net libraries. I wouldnt be able to delay the = configuring the logging. Instead if it would be possible to suppress the error popping up in = notepad or better yet to redirect the error to a log file without it = being displayed to the user, it would be great. Thanks and regards Vikas Manghani ----- Original Message -----=20 From: Robert Prouse=20 To: 'Log4NET User'=20 Sent: Monday, November 22, 2010 7:31 PM Subject: RE: Error while starting second instance of application If the second instance of your app is just displaying a message and = then shutting down, why don't you delay configuring logging until after = you have done your instance checks? Do this by calling = XmlConfigurator.Configure instead of using the assembly attribute to = configure logging. =20 Rob Prouse =20 From: Karim Bourouba [mailto:karym6@hotmail.com]=20 Sent: November-22-10 8:30 AM To: 'Log4NET User'; 'vikas manghani' Subject: RE: Error while starting second instance of application =20 Hi,=20 =20 Do you think maybe that you should only use one instance of your = application? Or try and generate a random named file that feeds a = general log file on exit? =20 You are probably getting this as you are specifying the same filename = for each instance in either your code or you .config. Have a think about = what it is you are actually trying to do right now. =20 K From: vikas manghani [mailto:vikas.manghani@datamatics.com]=20 Sent: 22 November 2010 13:14 To: log4net-user@logging.apache.org Subject: Error while starting second instance of application =20 Hi I am using log4net in my Windows CE application. I am getting the following error when I try to run a second instance = of my application on the device: "Unable to acquire lock on file . The process cannot access = the file because it is being used by another process". =20 Its clear that log4net is unable to lock the log files when the second = instance is started. The problem is that, this opens up in a notepad = window and then stays there till the second instance ends. I want to = prevent this error from being displayed to the user as I am showing an = informational message to indicate that only one instance of the = application can be started. Kindly let me know what can be done here to prevent the log4net error = popping up in Notepad. =20 Thanks and regards Vikas Manghani =20 =20 Disclaimer: The information contained in this e-mail and attachments = if any are privileged and confidential and are intended for the = individual(s) or entity(ies) named in this e-mail. If the reader or = recipient is not the intended recipient, or employee or agent = responsible for delivering to the intended recipient, you are hereby = notified that dissemination, distribution or copying of this = communication or attachments thereof is strictly prohibited. IF YOU = RECEIVE this communication in error, please immediately notify the = sender and return the original message.=20 =20 Disclaimer: The information contained in this e-mail and attachments if any are privileged and confidential and are intended for the individual(s) or entity(ies) named in this e-mail. If the reader or recipient is not the intended recipient, or employee or agent responsible for delivering to the intended recipient, you are hereby notified that dissemination, distribution or copying of this communication or attachments thereof is strictly prohibited. IF YOU RECEIVE this communication in error, please immediately notify the sender and return the original message. ------=_NextPart_000_0114_01CB8A86.476F0520 Content-Type: text/html;charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Robert
Thanks, but the logging mechanism of = our=20 application is based on a wrapper over the core log4net libraries. I = wouldnt be=20 able to delay the configuring the logging.
Instead if it would be possible to = suppress the=20 error popping up in notepad or better yet to redirect the error to a log = file=20 without it being displayed to the user, it would be great.
 
Thanks and regards
Vikas Manghani
----- Original Message -----
From:=20 Robert = Prouse
To: 'Log4NET User' =
Sent: Monday, November 22, 2010 = 7:31=20 PM
Subject: RE: Error while = starting second=20 instance of application

If=20 the second instance of your app is just displaying a message and then = shutting=20 down, why don=92t you delay configuring logging until after you have = done your=20 instance checks? Do this by calling XmlConfigurator.Configure instead = of using=20 the assembly attribute to configure logging.

 

Rob=20 Prouse

 

From: Karim=20 Bourouba [mailto:karym6@hotmail.com]
Sent: November-22-10 = 8:30=20 AM
To: 'Log4NET User'; 'vikas manghani'
Subject: = RE: Error=20 while starting second instance of=20 application

 

Hi,

 

Do you think maybe that you should only use one instance = of your=20 application? Or try and generate a random named file that feeds a = general log=20 file on exit?

 

You are probably getting this as you are specifying the = same=20 filename for each instance in either your code or you .config. Have a = think=20 about what it is you are actually trying to do right=20 now.

 

K

From: vikas=20 manghani [mailto:vikas.manghani@datamatics.com]
Sent: 22 = November=20 2010 13:14
To: = log4net-user@logging.apache.org
Subject:=20 Error while starting second instance of=20 application

 

Hi

I am=20 using log4net in my Windows CE application.

I am=20 getting the following error when I try to run a second instance of my=20 application on the device:

"Unable=20 to acquire lock on file <File Path>. The process cannot access = the file=20 <File Path> because it is being used by another = process".

 

Its=20 clear that log4net is unable to lock the log files when the second = instance is=20 started. The problem is that, this opens up in a notepad window and = then stays=20 there till the second instance ends. I want to prevent this error from = being=20 displayed to the user as I am showing an informational message to = indicate=20 that only one instance of the application can be started.

Kindly=20 let me know what can be done here to prevent the log4net error popping = up in=20 Notepad.

 

Thanks=20 and regards
Vikas Manghani

 

 



Disclaimer: The information contained in this e-mail = and=20 attachments if any are privileged and confidential and are intended = for the=20 individual(s) or entity(ies) named in this e-mail. If the reader or = recipient=20 is not the intended recipient, or employee or agent responsible for = delivering=20 to the intended recipient, you are hereby notified that dissemination, = distribution or copying of this communication or attachments thereof = is=20 strictly prohibited. IF YOU RECEIVE this communication in error, = please=20 immediately notify the sender and return the original message.=20

 


 



Disclaimer: The information contained in this e-mail and attachments if any are privileged and confidential and are intended for the individual(s) or entity(ies) named in this e-mail. If the reader or recipient is not the intended recipient, or employee or agent responsible for delivering to the intended recipient, you are hereby notified that dissemination, distribution or copying of this communication or attachments thereof is strictly prohibited. IF YOU RECEIVE this communication in error, please immediately notify the sender and return the original message.


------=_NextPart_000_0114_01CB8A86.476F0520--