|
You should just need to change the text “category” to “logger”. Then in your app call GetLogger(“XMLTest.WebForm1”).
-----Original Message-----
Tried that … did not work.
Did I needed to change the “Category” element name to “logger” or “log4net” or the name of the namespace / class.
From: Hart,
Aaron [mailto:[EMAIL PROTECTED]
Below your root logger configuration,I believe you need to change the “Category” element name to “logger”.
Aaron
-----Original Message-----
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
|
- RE: Log4net Configuration Settings Hart, Aaron
- RE: Log4net Configuration Settings Nicko Cadell
