This page: http://logging.apache.org/log4net/release/faq.html
says: " Internal debugging messages are written to the console and to the System.Diagnostics.Trace system " I'm not very familiar with .NET 2.0 apps but I would imagine you can still add code like this to your web.config. This redirects output sent to System.Diagnostics.Trace to a file: <system.diagnostics> <trace autoflush="true"> <listeners> <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\\Inetpub\\wwwroot\\Logs\\log4net.txt" /> </listeners> </trace> </system.diagnostics> System.Diagnostics.Trace is different from System.Web.HttpContext.Current.Trace. Log4net sends its debug messages to System.Diagnostics.Trace. Before adding that code to your web.config I would verify that you can create and write to the log4net.txt file. --- Ken Chu <[EMAIL PROTECTED]> wrote: > Yes, I have turned on internal debugging, but could you tell me where > to look > for the output of that? I also suspect log4net can't find the config > file, but > I don't understand why it doesn't work as part of web.config. > > Yes, I have tried trace output. That is what Trace.axd is supposed > to show, > but I don't see any log4net output there either. I only see .NET > trace output, > like this: > > Request Details > Session Id: fej2pg45qfqbuhrhfw240viz Request Type: POST > Time of Request: 3/23/2006 7:26:53 PM Status Code: 200 > Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8) > Trace Information > Category Message From First(s) From Last(s) > aspx.page Begin PreInit > aspx.page End PreInit 5.11238160157227E-05 0.000051 > aspx.page Begin Init 8.38095344520044E-05 0.000033 > ... > ... > Microsoft .NET Framework Version:2.0.50727.42; ASP.NET > Version:2.0.50727.42 > > -Ken > > --- Ron Grabowski <[EMAIL PROTECTED]> wrote: > > > Have you tried following these instructions? > > > > http://logging.apache.org/log4net/release/faq.html#internalDebug > > > > and verified that log4net is starting correctly? Maybe log4net > can't > > find its config file. I would also try using an appender that does > not > > require file access to verify that log4net has been configured > > correctly: > > > > <appender name="AspNetTraceAppender" > > type="log4net.Appender.AspNetTraceAppender" > > > <layout type="log4net.Layout.PatternLayout" /> > > </appender> > > > > Once that is working you can concentrate on the FileAppender. > > > > --- Ken Chu <[EMAIL PROTECTED]> wrote: > > > > > Hi .Net developers, > > > > > > I've been trying to get the log4net 1.2.9 beta's WebApp example > to > > > work under > > > ASP.NET 2.0 without any luck (using C# in VS2005). I don't get > any > > > log files > > > nor trace output when I go to http://myhost/WebAppCS/Trace.axd. > Here > > > are the > > > things I've tried to do: > > > > > > - make sure the directory for the log file is writable > > > - setting the output log file with absolute path > > > (c:\tmp\webapp-log.txt) > > > - change '\' to '\\' in the WebApp.dll.log4net file > > > - copy the content of WebApp.dll.log4net into Web.config > > > - turn on log4net internal debug flag (where does this output > to?) > > > > > > Could someone tell me what I'm missing? Why isn't the > WebForm1.asp > > > page > > > producing a log file or trace output? Is this because I > converted > > > this .NET > > > 1.0 project to .NET 2.0? > > > > > > Below is my current web.config file. Any help would be > appreciated. > > > > > > -Ken > > > --------------------------------------------------- > > > <?xml version="1.0"?> > > > <configuration> > > > <configSections> > > > <section name="log4net" > > > type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" > /> > > > </configSections> > > > <appSettings> > > > <!-- To enable internal log4net logging specify the > > > following appSettings key --> > > > <add key="log4net.Internal.Debug" value="true"/> > > > </appSettings> > > > <system.web> > > > <!-- DYNAMIC DEBUG COMPILATION > > > Set compilation debug="true" to enable ASPX debugging. > > > Otherwise, > > > setting this value to > > > false will improve runtime performance of this > application. > > > > > > Set compilation debug="true" to insert debugging > symbols > > > (.pdb > > > information) > > > into the compiled page. Because this creates a larger > file > > > that > > > executes > > > more slowly, you should set this value to true only > when > > > debugging > > > and to > > > false at all other times. For more information, refer > to > > > the > > > documentation about > > > debugging ASP .NET files. > > > --> > > > <compilation defaultLanguage="c#" debug="true"> > > > <!-- below doesn't work in .NET 2.0. > > > <compilers> > > > <compiler language="c#" > > > type="Microsoft.CSharp.CSharpCodeProvider, System, > > > Version=2.0.0.0, Culture=neutral, > PublicKeyToken=B77A5C561934E089" > > > extension=".cs" compilerOptions="/d:DEBUG;TRACE"/> > > > </compilers> --> > > > </compilation> > > > <!-- CUSTOM ERROR MESSAGES > > > Set customError mode values to control the display of > > > user-friendly > > > error messages to users instead of error details > (including > > > a stack > > > trace): > > > > > > "On" Always display custom (friendly) messages > > > "Off" Always display detailed ASP.NET error > information. > > > "RemoteOnly" Display custom (friendly) messages only to > > > users not > > > running > > > on the local Web server. This setting is recommended > for > > > security > > > purposes, so > > > that you do not display application detail information > to > > > remote > > > clients. > > > --> > > > <customErrors mode="RemoteOnly"/> > > > <!-- AUTHENTICATION > > > This section sets the authentication policies of the > > > application. > > > Possible modes are "Windows", "Forms", > > > "Passport" and "None" > > > --> > > > <!-- authentication mode="Windows" / --> > > > <!-- APPLICATION-LEVEL TRACE LOGGING > > > Application-level tracing enables trace log output for > > > every page > > > within an application. > > > Set trace enabled="true" to enable application trace > > > logging. If > > > pageOutput="true", the > > > trace information will be displayed at the bottom of > each > > > page. > > > Otherwise, you can view the > > > application trace log by browsing the "trace.axd" page > from > > > your web > > > application > > > root. > > > --> > > > <trace enabled="true" requestLimit="20" pageOutput="false" > > > traceMode="SortByTime" localOnly="true"/> > > > <!-- SESSION STATE SETTINGS > > > By default ASP .NET uses cookies to identify which > requests > > > belong to > > > a particular session. > > > If cookies are not available, a session can be tracked > by > > > adding a > > > session identifier to the URL. > > > To disable cookies, set sessionState cookieless="true". > > > --> > > > <!--sessionState > > > mode="InProc" > > > stateConnectionString="tcpip=127.0.0.1:42424" > > > sqlConnectionString="data source=127.0.0.1;user > > > id=sa;password=" > > > cookieless="false" > > > timeout="20" > > > /--> > === message truncated ===
