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> </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> 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> </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><configuration></P>
<P><configSections></P>
<P><section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /></P>
<P></configSections></P>
<P><log4net></P>
<P></P>
<P><appender name="LogFileAppender" type="log4net.Appender.FileAppender" ></P>
<P><param name="File" value="transform.log" /></P>
<P><param name="AppendToFile" value="true" /></P>
<P><Layout type="log4net.Layout.PatternLayout"></P>
<P><param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /></P>
<P></Layout></P>
<P><layout type="log4net.Layout.PatternLayout"></P>
<P><param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /></P>
<P></layout></P>
<P></appender></P>
<P><appender name="ConsoleAppender" </P>
<P>type="log4net.Appender.ConsoleAppender" ></P>
<P><layout type="log4net.Layout.PatternLayout"></P>
<P><param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /></P>
<P></layout></P>
<P></appender></P>
<P><logger name="testApp.Logging"></P>
<P><level value="DEBUG"/></P>
<P><appender-ref ref="LogFileAppender" /></P>
<P><appender-ref ref="ConsoleAppender"/></P>
<P></logger></P>
<P><root></P>
<P><priority value="DEBUG" /></P>
<P><appender-ref ref="LogFileAppender" /></P>
<P></root></P>
<P></log4net></P>
<P> </configuration></P>
<P>1. I made the referece in the following path.</P>
<P> C:\Log4Net\log4net-1.2.0-beta8\bin\net\1.1\release\log4net.dll</P>
<P> </P>
<P>Problem Description.</P>
<P>-----------------------------.</P>
<P>1. i don't find any log file named "transform.log" in the application root.</P>
<P>2. Even in the debug 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> </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