Have you tried specifying a known writable path for the log file:
<param name="File" value="c:\\inetpub\\wwwroot\\log.txt" />
The #1 problem people have with log4net and web applications is that
log4net does not have the correct permissions to write a file.
In your Application_Start, try creating a TextWriter in the same folder
you would like to store your log files in and see if you get an
exception.
--- Ling Wang <[EMAIL PROTECTED]> wrote:
> Zarar,
>
> I did what you are suggesting. Still no luck finding
> where log.txt is.
> Here is my assembly.cs file:
>
> using System.Reflection;
> using System.Runtime.CompilerServices;
>
> [assembly: AssemblyTitle("NPetShop")]
> [assembly: AssemblyDescription("Fully functional web
> application based on iBATIS.NET")]
> [assembly: AssemblyConfiguration("")]
> [assembly: AssemblyCompany("")]
> [assembly: AssemblyProduct("")]
> [assembly: AssemblyCopyright("Gilles Bayon")]
> [assembly: AssemblyTrademark("")]
> [assembly: AssemblyCulture("")]
>
> [assembly: log4net.Config.DOMConfigurator(Watch=true)]
>
>
> [assembly: AssemblyVersion("1.0.0.*")]
>
> [assembly: AssemblyDelaySign(false)]
> [assembly: AssemblyKeyFile("")]
> [assembly: AssemblyKeyName("")]
>
> and here is my web.config file:
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>
> <configSections>
> <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler,
> log4net" />
> </configSections>
>
> <appSettings>
> <add key="StrutsConfigFile"
> value="nstruts-config.xml" />
> <add key="log4net.Internal.Debug" value="true"/>
> </appSettings>
>
> <system.web>
> <compilation
> defaultLanguage="c#"
> debug="true"
> />
>
> <customErrors
> mode="RemoteOnly"
> />
>
> <authentication mode="Windows" />
>
> <authorization>
> <allow users="*" /> <!-- Allow all users -->
> <!-- <allow users="[comma separated
> list of users]"
> roles="[comma separated
> list of roles]"/>
> <deny users="[comma separated
> list of users]"
> roles="[comma separated
> list of roles]"/>
> -->
> </authorization>
>
> <trace
> enabled="false"
> requestLimit="10"
> pageOutput="false"
> traceMode="SortByTime"
> localOnly="true"
> />
>
> <sessionState
> mode="InProc"
>
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data
> source=127.0.0.1;Trusted_Connection=yes"
> cookieless="false"
> timeout="20"
> />
>
> <globalization
> requestEncoding="utf-8"
> responseEncoding="utf-8"
> />
> </system.web>
>
> <!-- This section contains the log4net configuration
> settings -->
> <log4net>
> <!-- Define some output appenders -->
> <appender name="RollingLogFileAppender"
> type="log4net.Appender.RollingFileAppender">
> <param name="File" value="log.txt" />
> <param name="AppendToFile" value="true" />
> <param name="MaxSizeRollBackups" value="2" />
> <param name="MaximumFileSize" value="100KB" />
> <param name="RollingStyle" value="Size" />
> <param name="StaticLogFileName" value="true" />
> <layout type="log4net.Layout.PatternLayout">
> <param name="Header" value="[Header]\r\n" />
> <param name="Footer" value="[Footer]\r\n" />
> <param name="ConversionPattern" value="%d [%t]
> %-5p %c [%x] - %m%n" />
> </layout>
> </appender>
> <appender name="ConsoleAppender"
> type="log4net.Appender.ConsoleAppender">
> <layout type="log4net.Layout.PatternLayout">
> <param name="ConversionPattern" value="%d [%t]
> %-5p %c [%x] <%X{auth}> - %m%n" />
> </layout>
> </appender>
>
> <!-- OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -->
> <!-- Set root logger level to ERROR and its
> appenders -->
> <root>
> <level value="ERROR" />
> <appender-ref ref="RollingLogFileAppender" />
> <appender-ref ref="ConsoleAppender" />
> </root>
>
> <!-- Print only messages of level DEBUG or above in
> the packages -->
> <logger
> name="IBatisNet.DataMapper.Commands.DefaultPreparedCommand">
> <level value="DEBUG" />
> </logger>
> <logger
> name="IBatisNet.DataMapper.Configuration.Cache.CacheModel">
> <level value="DEBUG" />
> </logger>
> <logger name="IBatisNet.DataMapper.LazyLoadList">
> <level value="DEBUG" />
> </logger>
> <logger name="IBatisNet.DataMapper.SqlMapSession">
> <level value="DEBUG" />
> </logger>
> <logger
> name="IBatisNet.Common.Transaction.TransactionScope">
> <level value="DEBUG" />
> </logger>
> <logger name="IBatisNet.DataAccess.DaoSession">
> <level value="DEBUG" />
> </logger>
> <logger
> name="IBatisNet.DataAccess.Configuration.DaoProxy">
> <level value="DEBUG" />
> </logger>
> <logger
>
name="IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory">
> <level value="OFF" />
> </logger>
> <logger
> name="IBatisNet.DataMapper.Commands.IPreparedCommand">
> <level value="OFF" />
> </logger>
> </log4net>
>
>
> </configuration>
>
>
> Thanks.
>
> Ling