The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.
| Author |
Messages |
|
ruchika baruah
 |
| 04/19/2006 6:39 AM |
|
Hi
I am having a problem with Log4net. I am using log4net 1.2.0. I have a asp.net , c# web application running in windows2000 server. When the application is placed in any folder and created a virtual directory in IIS , it works fine- log file is created (ie . file appender works fine). but if I place the application under c:\inetpub\wwwroot, it stops logging to the file. I have given full permission to aspnet, network service user for that log folder. Although, trace appender still works.
Can somebody pls help me.
thanks
Ruchika |
|
|
|
|
Matthew Brown
 |
| 04/19/2006 4:41 PM |
|
Can you share your logging configuration?
|
|
|
|
|
ruchika baruah
 |
| 04/19/2006 6:00 PM |
|
Thanks Matthew,
here is the configuration
< configuration><configSections >
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
<appSettings></appSettings ><add key="log4net.Internal.Debug " value="true"/>
</appSettings>
< system.diagnostics><trace autoflush="true"><listeners ><add name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener" initializeData ="C:\tmp\log4net.txt" /></ listeners></trace>
</system.diagnostics></ configSections>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="C:\\Inetpub\\wwwroot\\WebApplication2\\Log\\test.log" />
<!--<param name="File" value="Log\test.log" />-->
<param name="AppendToFile" value="true" />
<param name="MaxSizeRollBackups" value="10" />
<param name="MaximumFileSize" value="10MB" />
<param name="RollingStyle" value="Size" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout ">
<param name="Header" value="\r\n\r\n---------------------------------------------\r\n" />
<param name="Footer" value="\r\n---------------------------------------------\r\n\r\n" />
<param name="ConversionPattern" value="%d [%t] %-5p - %m%n" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingLogFileAppender" />
<!--<appender-ref ref="ColoredConsoleAppender" />-->
</root>
</log4net>
</ configuration>
-Ruchika
|
|
|
|
|
Hollywood
 |
| 04/19/2006 7:08 PM |
|
I'd change the <param name="File" value="......"> to be <param name="File" value="Log\\test.log"/>. And make sure the Log directory is created under your WebApplication2 and has read/write permissions for the account that IIS is running under, probably the Local Service or Network Service account This is assuming that the applciation that is logging is WebApplication2. I've done this for IIS on XP, Win2000 and 2003 Server. |
|
|
|
|
Nicko Cadell
 |
| 04/23/2006 11:12 PM |
|
There is a known issue with old versions of log4net FileAppender where it tries to create the log folder even if it exists. This fails if the credentials don't allow creating the folder, even if the folder already exists. This may be causing the problem you are seeing. To verify make sure that you grant the appropriate user full permissions on the log folder and all parent folders.
This issue is fixed in the latest version of log4net - please retry this with 1.2.10.
Cheers, Nicko
|
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.7
|