You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Pattenaude, Jerry" <Je...@RedPrairie.com> on 2008/03/12 18:09:44 UTC

logging from web service and a web page

I have had a web service logging for a while now and it works great
(I'll call it ws).  The log4net.dll runs in the standard aspnet_wp.exe
and logs using the rollingfileappender with minimal lock.

 

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

 

I've recently added another module to my site that does some session
management as part of the ASP.Net pipeline.  It is logging using the
same configuration file and the same output file.  Now the session
module is getting created first and all of its log messages are getting
through, but the ws app log messages are not being created.

 

I turned on the debug for log4net and am running DebugView and I get the
following

 

log4net:ERROR [RollingFileAppender] Unable to acquire lock on file
c:\log\Log.txt. Access to the path 'c:\log\Log.txt' is denied.

 

So just to recap the ws messages were getting through.  I added the
session dll and now its messages are getting through and not my ws
messages.  When I remove the session dll then the ws messages start
coming through again.

 

Oh and just to add a little more info when I turn on the Event Log
Appender all the messages get logged.

 

Do you have any idea what would cause this?

 

Thanks in advance,

jerry



This e-mail is confidential and is intended solely for the use of the addressee(s). Opinions expressed are solely those of the author and may not be those of RedPrairie. Content is not to be relied upon by any person other than the addressee(s), without prior written approval of RedPrairie. If you are not the intended recipient, please notify us immediately, destroy any copies and delete from your computer systems.
If you have received this e-mail in error, any use, disclosure, dissemination, forwarding, printing or copying is strictly prohibited.
Although this email and any attachments are believed to be free of any virus or other defects which might affect any computer or IT system into which they are received, no responsibility is accepted by RedPrairie for any loss or damage arising in any way from the receipt or use therein.

RE: Log4Net and Powershell

Posted by dm...@verizon.net.
Hi, I'd like to see your code.

I am not yet convinced using Log4net within Powershell is a viable
option...??


-----Original Message-----
From: Daniel Marohn [mailto:marohn@sipgate.de] 
Sent: Thursday, March 13, 2008 4:13 AM
To: Log4NET User
Subject: Re: Log4Net and Powershell

HI

Yes, I mamanged to kick it into live.

I guess you have the following problem: The App-Domain is definied by
the Powershell. This is, why the workingdir of your powershell-snapin
is not the path where your dll is located, but the path of
PowerShell's exe.

There is more than one way to specify where the location of the
configfile. Let me know if you still need to see some lines of code.


Re: Log4Net and Powershell

Posted by Daniel Marohn <ma...@sipgate.de>.
HI

Yes, I mamanged to kick it into live.

I guess you have the following problem: The App-Domain is definied by
the Powershell. This is, why the workingdir of your powershell-snapin
is not the path where your dll is located, but the path of
PowerShell's exe.

There is more than one way to specify where the location of the
configfile. Let me know if you still need to see some lines of code.

Log4Net and Powershell

Posted by dm...@verizon.net.
I was wondering if there are any users out there using Log4Net with
Powershell successfully?

 

If so ,I'd be interested in seeing your sample code.

 

 Thanks


RE: logging from web service and a web page

Posted by "Pattenaude, Jerry" <Je...@RedPrairie.com>.
I've dug into my problem a little bit more and have some addition
information.  I'm still hoping that someone will have run into this
and/or knows this to be a limitation of the file appender.

 

My web service app and my asp.net app are separate visual studio
projects.  Both projects reference log4net.dll.  When aspnet_wp.exe
loads the applications it loads log4net.dll twice into the same
aspnet_wp process, but different app domains.  It appears that even with
minimal lock the file is still locked, so it cannot be used from a
different app domain in the same process.

 

Does anyone have any ideas on this?  Is it a log4net bug?

 

Thanks.

 

________________________________

Sent: Wednesday, March 12, 2008 1:10 PM
To: log4net-user@logging.apache.org
Subject: logging from web service and a web page

 

I have had a web service logging for a while now and it works great
(I'll call it ws).  The log4net.dll runs in the standard aspnet_wp.exe
and logs using the rollingfileappender with minimal lock.

 

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

 

I've recently added another module to my site that does some session
management as part of the ASP.Net pipeline.  It is logging using the
same configuration file and the same output file.  Now the session
module is getting created first and all of its log messages are getting
through, but the ws app log messages are not being created.

 

I turned on the debug for log4net and am running DebugView and I get the
following

 

log4net:ERROR [RollingFileAppender] Unable to acquire lock on file
c:\log\Log.txt. Access to the path 'c:\log\Log.txt' is denied.

 

So just to recap the ws messages were getting through.  I added the
session dll and now its messages are getting through and not my ws
messages.  When I remove the session dll then the ws messages start
coming through again.

 

Oh and just to add a little more info when I turn on the Event Log
Appender all the messages get logged.

 

Do you have any idea what would cause this?

 

Thanks in advance,

jerry



This e-mail is confidential and is intended solely for the use of the addressee(s). Opinions expressed are solely those of the author and may not be those of RedPrairie. Content is not to be relied upon by any person other than the addressee(s), without prior written approval of RedPrairie. If you are not the intended recipient, please notify us immediately, destroy any copies and delete from your computer systems.
If you have received this e-mail in error, any use, disclosure, dissemination, forwarding, printing or copying is strictly prohibited.
Although this email and any attachments are believed to be free of any virus or other defects which might affect any computer or IT system into which they are received, no responsibility is accepted by RedPrairie for any loss or damage arising in any way from the receipt or use therein.