Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 35032 invoked from network); 31 Jan 2006 11:34:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jan 2006 11:34:02 -0000 Received: (qmail 83541 invoked by uid 500); 31 Jan 2006 11:33:52 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 83500 invoked by uid 500); 31 Jan 2006 11:33:51 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 83411 invoked by uid 99); 31 Jan 2006 11:33:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2006 03:33:51 -0800 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=HTML_MESSAGE,INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of geert.verbakel@gmail.com designates 64.233.162.205 as permitted sender) Received: from [64.233.162.205] (HELO zproxy.gmail.com) (64.233.162.205) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2006 03:33:48 -0800 Received: by zproxy.gmail.com with SMTP id x7so1307036nzc for ; Tue, 31 Jan 2006 03:33:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ViF0y5nCq6TN/e8moZvPlMCXY40aOmCenuuHMr9POWu311xzdxfem9p1oySOzarFYK7Pn6ctD7XY0W4PWBlMzKPqRuiyE/8UsnaYQ+5ZvV4K8iZjrT6ub5dXU/46x6TYgnzIVvBdgyAwz+5jU1r9aQQAtyIJR7t1f2RpHG0fZOA= Received: by 10.65.230.1 with SMTP id h1mr1016489qbr; Tue, 31 Jan 2006 03:33:27 -0800 (PST) Received: by 10.64.142.9 with HTTP; Tue, 31 Jan 2006 03:33:27 -0800 (PST) Message-ID: <62d058260601310333r5e50a481t2a3486ff0ec74687@mail.gmail.com> Date: Tue, 31 Jan 2006 12:33:27 +0100 From: Geert Verbakel To: Log4NET User Subject: Re: ASP.NET starter help. In-Reply-To: <4c6366fa0601302208t517a5449w346cc057286362d0@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10106_29373009.1138707207717" References: <4c6366fa0601302208t517a5449w346cc057286362d0@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_10106_29373009.1138707207717 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Devin, I am having the same problem for logging in Application_Start and Session_Start. However all other logging is working fine (in the pages + also in global.asax, but only in Session_End and Application_End) Regards, Geert On 1/31/06, Devin Smith wrote: > > Hi, > > I've spent a number of hours trying to get log4net to log something in > an ASP.NET project but have not gotten anywhere. Hopefully someone can > tell me what's going on here. > > In the AssemblyInfo.cs file for my main site I have: > > [assembly: log4net.Config.Repository("SiteCore")] > [assembly: log4net.Config.XmlConfigurator(ConfigFileExtension=3D"log4net"= , > Watch=3Dtrue)] > > In Global.ascx.cs: > > // Class fields > private static readonly ILog log =3D > log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMetho= d > ().DeclaringType); > > and inside Application_Start: > > public void Application_Start(object sender, EventArgs e) > { > log4net.Config.XmlConfigurator.Configure(); > log.Info("Hello World, I am a logger"); > } > > Now because I have the settings above in my AssemblyInfo.cs I need a > seperate config file (well according to the mailing list, and many > blog sites). Inside the bin of my ASP.net project I have a > SiteCore.dll.log4net file that contains the following: > > > > > > type=3D"log4net.Appender.RollingFileAppender,log4net"> > value=3D"C:\\Inetpub\\wwwroot\\test1\\LogFiles\\mylog.txt"/> > > > > > > > > value=3D"%d [%t] %-5p %c [%x] - %m%n"/> > > > > > > > > > > > Now, I checked that LogFiles is writeable by ASPNET and I also created > a 0 byte mylog.txt and made it writeable by ASPNET as well. > > I'm not sure what i'm doing wrong but any help is appreciated. > > Thanks, > > Devin > ------=_Part_10106_29373009.1138707207717 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Devin,
 
I am having the same problem for logging in Application_Start and Sess= ion_Start.
However all other logging is working fine (in the pages + also in glob= al.asax, but only in Session_End and Application_End)
 
Regards,
Geert

 
On 1/31/06, = Devin Smith <devinsmith@gmai= l.com> wrote:
Hi,

I've spent a number o= f hours trying to get log4net to log something in
an ASP.NET project but have not gotten anywhere. Hopefully someone can
= tell me what's going on here.

In the AssemblyInfo.cs file for my mai= n site I have:

[assembly: log4net.Config.Repository("SiteCore&q= uot;)]
[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension=3D"l= og4net",
Watch=3Dtrue)]

In Global.ascx.cs:

// Class f= ields
private static readonly ILog log =3D
log4net.LogManager.GetLogg= er (System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

and= inside Application_Start:

public void Application_Start(object send= er, EventArgs e)
{
        &n= bsp;      log4net.Config.XmlConfigurator.Configure ();
           &n= bsp;   log.Info("Hello World, I am a logger");
}
=
Now because I have the settings above in my AssemblyInfo.cs I need aseperate config file (well according to the mailing list, and many
blog sites). Inside the bin of my ASP.net project I have a
SiteCore.= dll.log4net file that contains the following:

<?xml version=3D&qu= ot;1.0" encoding=3D"utf-8" ?>
<!-- This section con= tains the log4net configuration settings -->
<log4net>
       <!-- Define = some output appenders -->
       <ap= pender name=3D"RollingLogFileAppender"
    = ;             t= ype=3D"log4net.Appender.RollingFileAppender,log4net">
          <param n= ame=3D"File"
        &= nbsp;    value=3D"C:\\Inetpub\\wwwroot\\test1\\LogFiles= \\mylog.txt"/>
        &= nbsp; <param name=3D"AppendToFile" value=3D"true&quo= t;/>

       <param name=3D"MaxSizeRollBack= ups" value=3D"10"/>
     &nbs= p; <param name=3D"MaximumFileSize" value=3D"5MB"/>= ;
       <param name=3D"RollingSty= le" value=3D"Size"/>
       <param name=3D"StaticLogFi= leName" value=3D"true"/>
     = ;  <layout type=3D"log4net.Layout.PatternLayout,log4net"&= gt;
           &n= bsp;   <param name=3D"ConversionPattern"
            = ;   value=3D"%d [%t] %-5p %c [%x] - %m%n"/>
 = ;      </layout>
    =    </appender>

       = <!-- Setup the root category, add the appenders and set the default
p= riority -->
       <root>
   =             <leve= l value=3D"DEBUG" />
      &n= bsp;        <appender-ref ref=3D"= ;RollingLogFileAppender" />
      = </root>
</log4net>

Now, I checked that LogFiles is w= riteable by ASPNET and I also created
a 0 byte mylog.txt and made it writeable by ASPNET as well.

I'm = not sure what i'm doing wrong but any help is appreciated.

Thanks,
Devin

------=_Part_10106_29373009.1138707207717--