In your posting for the webconfig, it looks like the configuration handler 
class name is not capitalized properly (the 'c' in configuration should be 
capitalized).  Try:

<section name="log4net"
    type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

As another pointed out, make sure you call the DOMConfigurator.Configure() 
method as part of Application_Start in global.asax.cs

Hope this helps.

-Mike

On Friday 26 November 2004 06:03 am, Marc Eggenberger wrote:
> Hi there ...
>
>
>
> I'm trying to use log4net with one of my asp.net applications. I used
> log4net for some windows apps already but I have some problems now ... here
> my env
>
>
>
> .net framework 1.1
>
> log4net 1.2.0-beta8
>
> I have the following in my web.config:
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> <configuration>
>
> <configSections>
>
> <section name="log4net"
> type="log4net.Config.Log4NetconfigurationSectionHandler,log4net" />
>
> </configSections>
>
> <!-- This section contains the log4net configuration settings -->
>
> <log4net debug="true">
>
> <!-- Define some output appenders -->
>
> <appender name="RollingLogFileAppender"
> type="log4net.Appender.RollingFileAppender">
>
> <param name="File" value="log\\log.txt" />
>
> <param name="AppendToFile" value="true" />
>
> <param name="MaxSizeRollBackups" value="10" />
>
> <param name="MaximumFileSize" value="5MB" />
>
> <param name="RollingStyle" value="Size" />
>
> <param name="StaticLogFileName" value="true" />
>
> <layout type="log4net.Layout.PatternLayout">
>
> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
>
> </layout>
>
> </appender>
>
> <!-- Setup the root category, add the appenders and set the default level
> -->
>
> <root>
>
> <level value="DEBUG" />
>
> <appender-ref ref="RollingLogFileAppender" />
>
> </root>
>
> </log4net>
>
> this would log into the log directory in my root path of the asp.net
> application .. right? This folder exists and aspnet user has full control
> on it.
>
> In the source of the Default.aspx for example I have:
>
> namespace UniqueIDUserInterface
>
> {
>
> ....
>
> // Create a logger for use in this class
>
> private static readonly log4net.ILog log =
> log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod(
>).DeclaringType);
>
>
>
> And in the procedures I use
>
> log.Error("Erorr blablablabla");
>
> this should be correct, yes?
>
> But it does not log anything
>
> Also I thought that <log4net debug="true"> should enable internal debugging
> ...
>
> Somehow I think that all my settings in web.config are not used .... could
> that be?
>
> What can I do to debug this problem?
>
> Any ideas?

Reply via email to