RE: Please Help to configure Log4net with .net ap plication

Nicko Cadell <[email protected]> Mon, 9 Feb 2004 09:20:28 -0000
Newsgroups gmane.comp.windows.dotnet.log4net.user
Message-ID <[email protected]>
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3EEED.F56F1954
Content-Type: text/plain

Can you try turning on internal log4net debug?
 
 Add the following to the appSettings section of your application's .config
file
<?xml version="1.0" encoding="utf-8" ?>

<configuration>

	<appSettings>

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

	</appSettings>

</configuration>
The debug should be written to the console. If that doesn't help you figure
out what is wrong then post the results here.
For more info see
http://log4net.sourceforge.net/release/latest/doc/manual/faq.html#internalDe
bug
<http://log4net.sourceforge.net/release/latest/doc/manual/faq.html#internalD
ebug> 
Thanks,
Nicko
 

-----Original Message-----
From: senguttuvan haridoss [mailto:[email protected]] 
Sent: 05 February 2004 06:29
To: [email protected]
Subject: [Log4net-users] Please Help to configure Log4net with .net
application


Hi ,

 

Please look at my log4net Implementation and Config.

[assembly: log4net.Config.DOMConfigurator(Watch=true)]

namespace RxHandler

{

public class RxDataHandler

{

    private static readonly log4net.ILog log =
log4net.LogManager.GetLogger("testApp.Logging");

public static void Main(string []args)

{

log.Warn("Testing");

}

}

}

 

My Application Deatails.

-------------------------------------

Console Application , path: C:\Projects\SolutionName\RxHandler\

My Configuration
file.(Name:RxHandler.exe.config,Path:C:\Projects\SolutionName\RxHandler\RxHa
ndler.exe.config

------------------------------

<configuration>

<configSections>

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

</configSections>

<log4net>



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

<param name="File" value="transform.log" />

<param name="AppendToFile" value="true" />

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

<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />

</Layout>

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

<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />

</layout>

</appender>

<appender name="ConsoleAppender" 

type="log4net.Appender.ConsoleAppender" >

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

<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />

</layout>

</appender>

<logger name="testApp.Logging">

<level value="DEBUG"/>

<appender-ref ref="LogFileAppender" />

<appender-ref ref="ConsoleAppender"/>

</logger>

<root>

<priority value="DEBUG" />

<appender-ref ref="LogFileAppender" />

</root>

</log4net>

 </configuration>

1. I made the referece in the following path.

  C:\Log4Net\log4net-1.2.0-beta8\bin\net\1.1\release\log4net.dll

 

Problem Description.

-----------------------------.

1. i don't find any log file named  "transform.log"  in the application
root.

2. Even in the debug  mode i found the appenders count is "0" in logger
object.

Counld you please tell me where i am wrong.

 


  _____  

Contact brides & grooms FREE! Only on www.shaadi.com. Register
<http://g.msn.com/8HMBENIN/2737??PS=> now!
------------------------------------------------------- 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
_______________________________________________ Log4net-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4net-users


------_=_NextPart_001_01C3EEED.F56F1954
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D559171709-09022004><FONT face=3DArial =
color=3D#0000ff size=3D2>Can=20
you try turning on internal log4net debug?</FONT></SPAN></DIV>
<DIV><SPAN class=3D559171709-09022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D559171709-09022004><!--StartFragment -->&nbsp;<FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Add the following to the appSettings section =
of your=20
application's .config file</FONT><PRE class=3Dcode>&lt;?xml =
version=3D"1.0" encoding=3D"utf-8" ?&gt;
&lt;configuration&gt;
	&lt;appSettings&gt;
		&lt;add key=3D"log4net.Internal.Debug" value=3D"true"/&gt;
	&lt;/appSettings&gt;
&lt;/configuration&gt;</PRE><PRE class=3Dcode><FONT face=3DArial =
color=3D#0000ff size=3D2>The debug should be written to the console. If =
that doesn't help you figure out what is wrong then post the results =
here.</FONT></PRE><PRE class=3Dcode><FONT face=3DArial color=3D#0000ff =
size=3D2>For more info see <A =
href=3D"http://log4net.sourceforge.net/release/latest/doc/manual/faq.htm=
l#internalDebug">http://log4net.sourceforge.net/release/latest/doc/manua=
l/faq.html#internalDebug</A></FONT></PRE><PRE class=3Dcode><FONT =
face=3DArial color=3D#0000ff size=3D2>Thanks,</FONT></PRE><PRE =
class=3Dcode><FONT face=3DArial color=3D#0000ff =
size=3D2>Nicko</FONT></PRE><PRE class=3Dcode><FONT face=3DArial =
color=3D#0000ff size=3D2></FONT>&nbsp;</PRE></SPAN></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
  face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B> =
senguttuvan=20
  haridoss [mailto:[email protected]] <BR><B>Sent:</B> 05 =
February 2004=20
  06:29<BR><B>To:</B> =
[email protected]<BR><B>Subject:</B>=20
  [Log4net-users] Please Help to configure Log4net with .net=20
  application<BR><BR></FONT></DIV>
  <DIV>
  <DIV class=3DRTE><FONT face=3D"Courier New" size=3D2>
  <P>Hi ,</P>
  <P>&nbsp;</P>
  <P>Please look at my log4net Implementation and Config.</P>
  <P>[assembly: log4net.Config.DOMConfigurator(Watch=3Dtrue)]</P>
  <P>namespace RxHandler</P>
  <P>{</P>
  <P>public class RxDataHandler</P>
  <P>{</P>
  <P>&nbsp;&nbsp;&nbsp; private static readonly log4net.ILog log =3D=20
  log4net.LogManager.GetLogger("testApp.Logging");</P>
  <P></FONT><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>public</FONT><FONT=20
  face=3D"Courier New" size=3D2> </FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
  size=3D2>static</FONT><FONT face=3D"Courier New" size=3D2> =
</FONT><FONT=20
  face=3D"Courier New" color=3D#0000ff size=3D2>void</FONT><FONT =
face=3D"Courier New"=20
  size=3D2> Main(</FONT><FONT face=3D"Courier New" color=3D#0000ff=20
  size=3D2>string</FONT><FONT face=3D"Courier New" size=3D2> =
[]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=20
  =
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=3D"log4net"=20
  type=3D"log4net.Config.Log4NetConfigurationSectionHandler,log4net" =
/&gt;</P>
  <P>&lt;/configSections&gt;</P>
  <P>&lt;log4net&gt;</P>
  <P></P>
  <P>&lt;appender name=3D"LogFileAppender" =
type=3D"log4net.Appender.FileAppender"=20
  &gt;</P>
  <P>&lt;param name=3D"File" value=3D"transform.log" /&gt;</P>
  <P>&lt;param name=3D"AppendToFile" value=3D"true" /&gt;</P>
  <P>&lt;Layout type=3D"log4net.Layout.PatternLayout"&gt;</P>
  <P>&lt;param name=3D"ConversionPattern" value=3D"%d [%t] %-5p %c [%x] =
- %m%n"=20
  /&gt;</P>
  <P>&lt;/Layout&gt;</P>
  <P>&lt;layout type=3D"log4net.Layout.PatternLayout"&gt;</P>
  <P>&lt;param name=3D"ConversionPattern" value=3D"%d [%t] %-5p %c [%x] =
- %m%n"=20
  /&gt;</P>
  <P>&lt;/layout&gt;</P>
  <P>&lt;/appender&gt;</P>
  <P>&lt;appender name=3D"ConsoleAppender" </P>
  <P>type=3D"log4net.Appender.ConsoleAppender" &gt;</P>
  <P>&lt;layout type=3D"log4net.Layout.PatternLayout"&gt;</P>
  <P>&lt;param name=3D"ConversionPattern" value=3D"%d [%t] %-5p %c [%x] =
- %m%n"=20
  /&gt;</P>
  <P>&lt;/layout&gt;</P>
  <P>&lt;/appender&gt;</P>
  <P>&lt;logger name=3D"testApp.Logging"&gt;</P>
  <P>&lt;level value=3D"DEBUG"/&gt;</P>
  <P>&lt;appender-ref ref=3D"LogFileAppender" /&gt;</P>
  <P>&lt;appender-ref ref=3D"ConsoleAppender"/&gt;</P>
  <P>&lt;/logger&gt;</P>
  <P>&lt;root&gt;</P>
  <P>&lt;priority value=3D"DEBUG" /&gt;</P>
  <P>&lt;appender-ref ref=3D"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=20
  application root.</P>
  <P>2. Even in the debug&nbsp; mode i found the appenders count is "0" =
in=20
  logger object.</P>
  <P>Counld you please tell me where i am wrong.</P></FONT><FONT=20
  face=3D"Times New Roman" size=3D2>
  <P>&nbsp;</P></FONT></DIV></DIV><BR clear=3Dall>
  <HR>
  Contact brides &amp; grooms FREE! <A=20
  href=3D"http://g.msn.com/8HMBENIN/2737??PS=3D">Only on =
www.shaadi.com. Register=20
  now!</A> ------------------------------------------------------- The =
SF.Net=20
  email is sponsored by EclipseCon 2004 Premiere Conference on Open =
Tools=20
  Development and Integration See the breadth of Eclipse activity. =
February 3-5=20
  in Anaheim, CA. http://www.eclipsecon.org/osdn=20
  _______________________________________________ Log4net-users mailing =
list=20
  [email protected]=20
  =
https://lists.sourceforge.net/lists/listinfo/log4net-users</BLOCKQUOTE><=
/BODY></HTML>

------_=_NextPart_001_01C3EEED.F56F1954--


-------------------------------------------------------
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