First I would make sure that the textWriterTraceListener is working correctly:

 System.Diagnostics.Trace.WriteLine("Hello World");

If that doesn't work then you won't be able to see the log4net internal debug 
messages.

Have you tried clearing out all the log4net config code except for the 
ConsoleAppender (since that's the simplest appender) then re-add each appender 
after you get that one working? I believe that internal debugging dumps output 
to the console in addition to System.Diagnostics.Trace.


----- Original Message ----

From: Dominick Cosgrove <[EMAIL PROTECTED]>

To: "[email protected]" <[email protected]>

Sent: Friday, June 29, 2007 7:34:15 AM

Subject: Log4Net Issue on Windows 2003 Server



I have a .Net 1.1 Console App that I have log4net implemented as the logger. 
The app logs correctly on my local machine (Win XP) but not my dev server (Win 
2003). I have tested the application on a number of other Win 2003 servers and 
it seems to run fine. I have enabled log4net internal debugging but nothing is 
being logged. When I debug the app on my Dev Server the log instance does not 
seem to be initialised correctly.

     

   private static readonly log4net.ILog log = 
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

     

   I've used the [assembly: log4net.Config.XmlConfigurator(Watch=true)] in the 
AssemblyInfo.cs to configure it. 

     

   Here is the App.Config:

     

     

   <?xml version="1.0" encoding="utf-8"?>

   <configuration>

         <configSections>

               <section name="log4net" 
type="System.Configuration.IgnoreSectionHandler" />

         </configSections>

         <appSettings>

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

               <add key="GPD.AD.UserInfo" 
value="http://gimvsrvdev100/WebServices/ActiveDirectory/UserInfo.asmx"/>

               <add key="GPD.ListsWS.Lists" 
value="http://gimvsrvdev100:88/Directory/_vti_bin/Lists.asmx"/>

               <add key="GPD.ListName" value="Gartmore Phone Book" />

         </appSettings>

         <log4net>

               <appender name="RollingLogFileAppender" 
type="log4net.Appender.RollingFileAppender">

                     <file value="C:\rolling-log.txt" />

                     <appendToFile value="true" />

                     <maxSizeRollBackups value="10" />

                     <maximumFileSize value="100" />

                     <rollingStyle value="Size" />

                     <staticLogFileName value="true" />

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

                           <header value="[Header]&#13;&#10;" />

                           <footer value="[Footer]&#13;&#10;" />

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

                     </layout>

               </appender>

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

                     <file value="C:\Logs\GPD_SYNC.log" />

                     <!-- Example using environment variables in params -->

                     <!-- <file value="${TMP}\log-file.txt" /> -->

                     <AppendToFile value="true" />

                     <!-- An alternate output encoding can be specified -->

                     <!-- <encoding value="unicodeFFFE" /> -->

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

                           <header value="[Header]&#13;&#10;" />

                           <footer value="[Footer]&#13;&#10;" />

                           <conversionPattern value="%date [%thread] %-5level 
%logger &lt;%property{auth}&gt; - %message%newline" />

                     </layout>

                     <!-- Alternate layout using XML                 

                     <layout type="log4net.Layout.XMLLayout" /> -->

               </appender>

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

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

                           <conversionPattern value="%date [%thread] %-5level 
%logger &lt;%property{auth}&gt; - %message%newline" />

                     </layout>

               </appender>

               <root>

                     <level value="ALL" />

                     <!--appender-ref ref="RollingLogFileAppender" /-->

                     <appender-ref ref="LogFileAppender" />

                     <!--appender-ref ref="ConsoleAppender" /-->

               </root>

         </log4net>

         <system.diagnostics>

     <trace autoflush="true">

       <listeners>

         <add 

           name="textWriterTraceListener" 

           type="System.Diagnostics.TextWriterTraceListener" 

           initializeData="C:\Logs\log4net.log" />

       </listeners>

     </trace>

   </system.diagnostics>

   </configuration>

     

   Any suggestions would be welcomed.

     

   Many thanks

     

   Dominick Cosgrove

   

   To view our disclaimer see http://epolicy.gartmore.com

 

  

 Gartmore Investment Management Limited (GIM), Gartmore Investment Limited 
(GIL) and Gartmore Fund Managers Limited (GFM) are all registered in England 
and Wales (nos 953703, 1508030 and 1137353). The registered address of GIM, GIL 
and GFM is Gartmore House, 8 Fenchurch Place, London, EC3M 4PB. Gartmore Global 
Partners (GGP) is a general partnership registered in Delaware, USA, EIN 
56-1903611. The registered office of GGP is One International Place, Fort Hill 
Square, Boston, Massachusetts 02110, USA.   GIL, GFM and GGP are authorised and 
regulated by the Financial Services Authority under the references 119236 
(GIL), 122610 (GFM) and 172616 (GGP). See www.fsa.gov.uk/register for more 
details. GGP is also a SEC registered investment advisor. 

  









Reply via email to