Return-Path: X-Original-To: apmail-logging-log4net-user-archive@www.apache.org Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9AB3010818 for ; Wed, 12 Jun 2013 23:26:06 +0000 (UTC) Received: (qmail 89124 invoked by uid 500); 12 Jun 2013 23:26:06 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 89078 invoked by uid 500); 12 Jun 2013 23:26:05 -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 89070 invoked by uid 99); 12 Jun 2013 23:26:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 23:26:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.139.212.165] (HELO nm6.bullet.mail.bf1.yahoo.com) (98.139.212.165) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 23:25:59 +0000 Received: from [98.139.212.146] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 12 Jun 2013 23:25:38 -0000 Received: from [98.139.212.233] by tm3.bullet.mail.bf1.yahoo.com with NNFMP; 12 Jun 2013 23:25:38 -0000 Received: from [127.0.0.1] by omp1042.mail.bf1.yahoo.com with NNFMP; 12 Jun 2013 23:25:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 46913.79399.bm@omp1042.mail.bf1.yahoo.com Received: (qmail 72201 invoked by uid 60001); 12 Jun 2013 23:25:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1371079537; bh=L0+kJhPVMz+mkQV9g59j3ons2hpDzqVxgYSSGXjcSXs=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=TNLZgEFf+uZuIt0iy4uobewBYtQBO/nAoDPGUz6ZvI+SjwY9d4MKlYMEnjh7xOY31qnT9thAS5WaJu0xI1nsZefB87K5p/bIqfI8P2G8g1myFHY99I28XDnQfBnHokHFAFzPwKiWmpQLllev6vfUFV+GrAwV07fISngH1cv/hDE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=EIJ1BPDvOWkxZO+akP3rTGGKAq3+BA2oAzv06mqh9W2dWvZ83QepiHZ8x8sFOcnERpURDoMu7UE0S9JBkcNDPAGSq5suJtckrWaoGLPfWNLG5HS1gsDJ3TtEzHXrvvD06IJ9N/M273aHa/iCdSQ7GFyAYDQU/sB7vkkeJZOg7/s=; X-YMail-OSG: EHTSHKgVM1nJYGtNwBOV.v3qfwoUuZ8zGnZ_N4HlokNJvLS 3gOYCdFOlcD5sA3AsYFlHVjBUrf6Anl4EYc1.uVJLikn_VErDvOqV8KiZf7q OyRhIDew0JSwGIwnKRqILvbS6xZWbRpi1QlLMr9JFLcUnKIFPh3xDaZ1exhH WKZApqzxJTfly_PlPyZkUiFnXGhXJ_Ip6U1AdT04TMWj7BtTvjLceYAG1nwI IKj8K0sgjXVmZdAUz0J4dtkQH0FjCi3kfRYj3ogxWSDLLsU4XEICFPok.GFi jhsIT.T5cR74O5ehbY7r6ZkRIA.MRrqXYokSNfFUVXttKM7bY92tGYvsPxbb vjHcPR0JQJ5U9QHCNZe6XdIvLqX.lLd58vtk39aWjbeswgnRi5Queo3pmvbx umEGUtrETTPZ2QyhW1CQB.coQc76HdIihM1LF6mQDtGUijorRSC4vhKWs4RY 5WIBb8jhEXp3rynvy0ZxHfGl6hDZfFnoizxRv4TKtBrUlb1CwQJ.CT6_PLan GK9su2wPazyyjRnSq0_XMfjOfomtC60L.1T86NgSjg29Vh7mywkQTObX80wn NWwZc7Mcfx4_M8UwoXhzNI_Oow0WUjkLipVdErrYE4aS8ZRTG6wUz5epWaAs kHsRIwBvjogv_ Received: from [75.180.61.21] by web161006.mail.bf1.yahoo.com via HTTP; Wed, 12 Jun 2013 16:25:37 PDT X-Rocket-MIMEInfo: 002.001,WW91IGNhbiB1c2UgYSBtaW5pbWFsIGxvY2sgb24geW91ciBGaWxlQXBwZW5kZXI6Cgo8bG9ja2luZ01vZGVsIHR5cGU9ImxvZzRuZXQuQXBwZW5kZXIuRmlsZUFwcGVuZGVyK01pbmltYWxMb2NrIiAvPgoKYnV0IGl0J2xsIHNsb3cgdGhpbmdzIGRvd24gYmVjYXVzZSBpdCB3aWxsIG9wZW4gYW5kIGNsb3NlIHRoZSBmaWxlIHdpdGggZWFjaCB3cml0ZS4gSSd2ZSB1c2VkIGNvZGUgbGlrZSB0aGlzIGJlZm9yZSB0byBvcGVuIGEgbG9ja2VkIGZpbGU6CgovLyBmcm9twqBodHRwOi8vd3d3LmVyaWNidC5jb20vQmwBMAEBAQE- X-Mailer: YahooMailWebService/0.8.146.552 References: Message-ID: <1371079537.69744.YahooMailNeo@web161006.mail.bf1.yahoo.com> Date: Wed, 12 Jun 2013 16:25:37 -0700 (PDT) From: Ron Grabowski Reply-To: Ron Grabowski Subject: Re: Log file availability issue To: Log4NET User In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-463083019-112145864-1371079537=:69744" X-Virus-Checked: Checked by ClamAV on apache.org ---463083019-112145864-1371079537=:69744 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable You can use a minimal lock on your FileAppender:=0A=0A=0A=0Abut it'll slow things d= own because it will open and close the file with each write. I've used code= like this before to open a locked file:=0A=0A// from=A0http://www.ericbt.c= om/Blog/48=0Ausing (FileStream fileStream =3D new FileStream(path, FileMode= .Open, FileAccess.Read, FileShare.ReadWrite))=0A{=0A=A0 using (StreamReader= streamReader =3D new StreamReader(fileStream))=0A=A0 {=0A=A0 =A0 logFileTe= xt =3D streamReader.ReadToEnd();=0A=A0 }=0A}=0A=0A=0A______________________= __________=0A From: "Chu, Greg" =0ATo: "log4net-user@l= ogging.apache.org" =0ASent: Wednesday, Ju= ne 12, 2013 9:44 AM=0ASubject: Log file availability issue=0A =0A=0A=0A =0A= During the application running the log file is locked. I am trying to email= the log file inside the application while the application is running.=0ADo= I have any way to close the log file so it is unlocked, so that I can get = the log file and email it?=0A=A0=0AThanks=0A=A0=0AGreg=0A=A0=0ANotice: This= e-mail message and its attachments are the property of The Wendy's Company= or one of its subsidiaries and may contain confidential or legally privile= ged information intended solely for the use of the addressee(s). If you are= not an intended recipient, then any use, copying or distribution of this m= essage or its attachments is strictly prohibited. If you received this mess= age in error, please notify the sender and delete this message entirely fro= m your system. ---463083019-112145864-1371079537=:69744 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
You can use a minimal lock= on your FileAppender:

<lockingModel type=3D"log= 4net.Appender.FileAppender+MinimalLock" />

but it'll slow things down because it will o= pen and close the file with each write. I've used code like this before to = open a locked file:

using (FileStream fileStream =3D new= FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
&= nbsp; using (StreamReader streamReader =3D new StreamReader(fileStream))
&n= bsp; {
    logFileText =3D streamReader.ReadToEnd();
  }<= /div>
}


From:= "Chu, Greg" <Greg.Chu@wendys.com>
To: "log4net-user@logging.apache.org" <log4net-us= er@logging.apache.org>
Sent:<= /span> Wednesday, June 12, 2013 9:44 AM
Subject:= Log file availability issue

=0A=0A =0A=0A=0A
=0A
=0A
During the application running the log file= is locked. I am trying to email the log file inside the application while = the application is running.
=0A
D= o I have any way to close the log file so it is unlocked, so that I can get= the log file and email it?
=0A
&= nbsp;
=0A
Thanks
=0A
 
=0A
Greg
=0A
 
=0A<= /div>=0ANotice: This e-mail message and its attachments are the property of= The Wendy's Company or one of its subsidiaries and may contain confidentia= l or legally privileged information intended solely for the use of the addr= essee(s). If you are not an intended recipient,=0A then any use, copying or= distribution of this message or its attachments is strictly prohibited. If= you received this message in error, please notify the sender and delete th= is message entirely from your system.=0A
=0A


---463083019-112145864-1371079537=:69744--