Very strange...

Remove your assembly attribute and try using this Application_OnStart
snippet along with the trace listener code I supplied in another post:

 protected void Application_Start(Object sender, EventArgs e)
 {
  log4net.Config.DOMConfigurator.Configure();
 }

--- Ling Wang <[EMAIL PROTECTED]> wrote:

> Ron,
> 
> No, it still does not work.
> I turned on the trace and I saw everyting BUT log4net
> output.
> 
> Here is my web.config:
> 
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> 
> <configSections>
>   <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler,
> log4net" />
>  </configSections>
>  
>       <appSettings>
>               <add key="StrutsConfigFile"
> value="nstruts-config.xml" />
>   <add key="log4net.Internal.Debug" value="true"/>
>       </appSettings>      
>       
>   <system.web>
>     <compilation 
>          defaultLanguage="c#"
>          debug="true"
>     />
> 
>     <customErrors 
>     mode="RemoteOnly" 
>     /> 
> 
>     <authentication mode="Windows" /> 
> 
> 
>     <authorization>
>         <allow users="*" /> <!-- Allow all users -->
>     </authorization>
> 
>     <trace
>         enabled="true"
>         requestLimit="10"
>         pageOutput="true"
>         traceMode="SortByTime"
>               localOnly="true"
>     />
> 
>     <sessionState 
>             mode="InProc"
>            
> stateConnectionString="tcpip=127.0.0.1:42424"
>             sqlConnectionString="data
> source=127.0.0.1;Trusted_Connection=yes"
>             cookieless="false" 
>             timeout="20" 
>     />
> 
>     <globalization 
>             requestEncoding="utf-8" 
>             responseEncoding="utf-8" 
>    />
>  </system.web>
> 
> <log4net>
>   <appender
>    name="AspNetTraceAppender" 
>    type="log4net.Appender.AspNetTraceAppender" >
>   <layout type="log4net.Layout.SimpleLayout" />
>   </appender>
>   <root>
>    <level value="ALL" />
>    <appender-ref ref="AspNetTraceAppender" />
>   </root>
>  </log4net>
>  
> 
> </configuration>
> 
> Thanks.
> 
> Ling
> 
> 
> --- Ron Grabowski <[EMAIL PROTECTED]> wrote:
> 
> > This log4net configuration will output messages
> > through ASP.Net's Trace
> > object:
> > 
> >  <log4net>
> >   <appender
> >    name="AspNetTraceAppender" 
> >    type="log4net.Appender.AspNetTraceAppender" >
> >   <layout type="log4net.Layout.SimpleLayout" />
> >   </appender>
> >   <root>
> >    <level value="ALL" />
> >    <appender-ref ref="AspNetTraceAppender" />
> >   </root>
> >  </log4net>
> > 
> > In your web.config file, make sure that Trace is
> > enabled and is being
> > output on the page:
> > 
> >  <trace enabled="true" pageOutput="true" />
> > 
> > --- Ling Wang <[EMAIL PROTECTED]> wrote:
> > 
> > > Ron,
> > > 
> > > My problem is with how to use log4net to view sql
> > > statement. Besides npetshop, I also tried the
> > > tutorial. None of them works. It would be nice if
> > > someone can show me how to do it. I tried almost
> > > everything according to the documentation.
> > > 
> > > Thanks.
> > > 
> > > Ling
> > 
> 
> 

Reply via email to