Please Help to configure Log4net with .net application

"senguttuvan haridoss" <[email protected]> Thu, 05 Feb 2004 06:28:43 +0000
Newsgroups gmane.comp.windows.dotnet.log4net.user
Message-ID <[email protected]>
<html><div style='background-color:'><DIV class=RTE><FONT face="Courier New" size=2>
<P>Hi ,</P>
<P>&nbsp;</P>
<P>Please look at my log4net Implementation and Config.</P>
<P>[assembly: log4net.Config.DOMConfigurator(Watch=true)]</P>
<P>namespace RxHandler</P>
<P>{</P>
<P>public class RxDataHandler</P>
<P>{</P>
<P>&nbsp;&nbsp;&nbsp; private static readonly log4net.ILog log = log4net.LogManager.GetLogger("testApp.Logging");</P>
<P></FONT><FONT face="Courier New" color=#0000ff size=2>public</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>static</FONT><FONT face="Courier New" size=2> </FONT><FONT face="Courier New" color=#0000ff size=2>void</FONT><FONT face="Courier New" size=2> Main(</FONT><FONT face="Courier New" color=#0000ff size=2>string</FONT><FONT face="Courier New" size=2> []args)</P>
<P>{</P>
<P>log.Warn("Testing");</P>
<P>}</P>
<P>}</P>
<P>}</P>
<P>&nbsp;</P>
<P>My Application Deatails.</P>
<P>-------------------------------------</P>
<P>Console Application , path: C:\Projects\SolutionName\RxHandler\</P>
<P>My Configuration file.(Name:RxHandler.exe.config,Path:C:\Projects\SolutionName\RxHandler\RxHandler.exe.config</P>
<P>------------------------------</P>
<P>&lt;configuration&gt;</P>
<P>&lt;configSections&gt;</P>
<P>&lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /&gt;</P>
<P>&lt;/configSections&gt;</P>
<P>&lt;log4net&gt;</P>
<P></P>
<P>&lt;appender name="LogFileAppender" type="log4net.Appender.FileAppender" &gt;</P>
<P>&lt;param name="File" value="transform.log" /&gt;</P>
<P>&lt;param name="AppendToFile" value="true" /&gt;</P>
<P>&lt;Layout type="log4net.Layout.PatternLayout"&gt;</P>
<P>&lt;param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /&gt;</P>
<P>&lt;/Layout&gt;</P>
<P>&lt;layout type="log4net.Layout.PatternLayout"&gt;</P>
<P>&lt;param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /&gt;</P>
<P>&lt;/layout&gt;</P>
<P>&lt;/appender&gt;</P>
<P>&lt;appender name="ConsoleAppender" </P>
<P>type="log4net.Appender.ConsoleAppender" &gt;</P>
<P>&lt;layout type="log4net.Layout.PatternLayout"&gt;</P>
<P>&lt;param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /&gt;</P>
<P>&lt;/layout&gt;</P>
<P>&lt;/appender&gt;</P>
<P>&lt;logger name="testApp.Logging"&gt;</P>
<P>&lt;level value="DEBUG"/&gt;</P>
<P>&lt;appender-ref ref="LogFileAppender" /&gt;</P>
<P>&lt;appender-ref ref="ConsoleAppender"/&gt;</P>
<P>&lt;/logger&gt;</P>
<P>&lt;root&gt;</P>
<P>&lt;priority value="DEBUG" /&gt;</P>
<P>&lt;appender-ref ref="LogFileAppender" /&gt;</P>
<P>&lt;/root&gt;</P>
<P>&lt;/log4net&gt;</P>
<P>&nbsp;&lt;/configuration&gt;</P>
<P>1. I made the referece in the following path.</P>
<P>&nbsp; C:\Log4Net\log4net-1.2.0-beta8\bin\net\1.1\release\log4net.dll</P>
<P>&nbsp;</P>
<P>Problem Description.</P>
<P>-----------------------------.</P>
<P>1. i don't find any log file named&nbsp; "transform.log"&nbsp; in the application root.</P>
<P>2. Even in the debug&nbsp; mode i found the appenders count is "0" in logger object.</P>
<P>Counld you please tell me where i am wrong.</P></FONT><FONT face="Times New Roman" size=2>
<P>&nbsp;</P></FONT></DIV></div><br clear=all><hr>Contact brides & grooms FREE! <a href="http://g.msn.com/8HMBENIN/2737??PS=">Only on www.shaadi.com. Register now!</a> </html>


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn