logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hart, Aaron" <ah...@zolldata.com>
Subject RE: Log4net Configuration Settings
Date Fri, 17 Dec 2004 19:19:49 GMT
Below your root logger configuration,I believe you need to change the
"Category" element name to "logger".

 

Aaron

 

-----Original Message-----
From: Abhijit Salvi [mailto:Abhijit.Salvi@albertsons.com] 
Sent: Friday, December 17, 2004 11:58 AM
To: log4net-user@logging.apache.org
Subject: Log4net Configuration Settings

 

Hi,

 

        I have recently started using the Log4net Tool. I read the
documentation and it has great potential for logging errors, debugging
purposes and tracing.

 

        However I have not been able to probably configure correctly
w.r.t. to my project.

 

        Here are my settings in the Web.Config.

 

 

<configSections>

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

      </configSections>

 

 

<log4net debug="true">

            <appender name="FileAppender"
type="log4net.Appender.FileAppender">

                  <file
value="c:\\Inetpub\\wwwroot\\XMLTest\\XMLTest1.txt" />

                  <appendToFile value="true" />

                  <layout type="log4net.Layout.PatternLayout">

                        <conversionPattern value="%date [%thread]
%-5level %logger [%ndc] - %message%newline" />

                  </layout>

            </appender>

            <appender name="XMLTestAppender"
type="log4net.Appender.FileAppender">

                  <file
value="c:\\Inetpub\\wwwroot\\XMLTest\\XMLTest1.txt" />

                  <appendToFile value="true" />

                  <layout type="log4net.Layout.PatternLayout">

                        <conversionPattern value="%date [%thread]
%-5level %logger [%ndc] - %message%newline" />

                  </layout>

            </appender>

            <root>

                  <priority value="ERROR"/>

                  <appender-ref ref="LogFileAppender"/>

            </root>

            <category name="XMLTest.WebForm1">

                  <priority value="ERROR"/>

                  <appender-ref ref="XMLTestAppender"/>

            </category>

      </log4net>

 

 

      <appSettings>

            <add key="log4net.Internal.Debug" value="true"/>

      </appSettings>

 

 

It is a .NET Web Application with namespace of XMLTest. It creates a dll
XMLTest.dll. However I debugged the Log4net code and it takes the
default Assembly instead of the XMLTest assembly. As a result the
XMLTest1.txt file is not created.

 

Could anyone please tell me what I need to do more? 

 

Thanks in advance,

 

Regards,

Abhi

 


Mime
View raw message