You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "McAninch, Robin" <RM...@russellmellon.com> on 2005/08/24 20:21:00 UTC

RE: I searched the archives and didn't see it jump out at me. I apologizeif I missed anything but here goes:

I thought that it would try and create the log file in the same directory as the application.  The windows applications do this at least by default.  I shall try this.  Thanks

-----Original Message-----
From: DWilliams@strohlsystems.com [mailto:DWilliams@strohlsystems.com]
Sent: Wednesday, August 24, 2005 2:20 PM
To: Log4NET User
Subject: Re: I searched the archives and didn't see it jump out at me. I
apologizeif I missed anything but here goes:


This is a standard problem with ASP.NET applications.  The problem is that
you are attempting to create the logfile.log in the System32 directory.
Add the full path to where you would like the file to be created and ensure
that the ASPNET user has write access to the directory.

HTH

David



                                                                           
             "McAninch, Robin"                                             
             <RMcAninc@russell                                             
             mellon.com>                                                To 
                                       <lo...@logging.apache.org>   
             08/24/2005 02:12                                           cc 
             PM                                                            
                                                                   Subject 
                                       I searched the archives and didn't  
             Please respond to         see it jump out at me.  I apologize 
              "Log4NET User"           if I missed anything but here goes: 
             <log4net-user@log                                             
             ging.apache.org>                                              
                                                                           
                                                                           
                                                                           
                                                                           




I searched the archives and didn't see it jump out at me.  I apologize if I
missed anything but here goes:

I have an ASP.NET app that will not log.  I am using version1.1.4322 on an
XP pentium IV Dell.  Upgrading versions right now isn't an option for me.
I have in the web config file these entries:

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

<!-- This section contains the log4net configuration settings -->
<log4net debug="true">
             <!-- Define some output appenders -->
             <appender name="rollingFile"
type="log4net.Appender.RollingFileAppender,log4net">
                         <param name="File" value="logfile.log" />
                         <param name="AppendToFile" value="true" />
                         <param name="RollingStyle" value="Date" />
                         <param name="DatePattern" value="yyyy.MM.dd" />
                         <param name="StaticLogFileName" value="true" />
                         <layout
type="log4net.Layout.PatternLayout,log4net">
                                     <param name="ConversionPattern"
value="%d [%t] %-5p %C - %M &lt;&gt; %m%n%n" />
                         </layout>
             </appender>
             <!-- Setup the root category, add the appenders and set the
default priority -->
             <root>
                         <level value="DEBUG" />
                         <appender-ref ref="rollingFile" />
             </root>
</log4net>

In the classes I have entered:

private static readonly ILog log =
LogManager.GetLogger(typeof([classnameHere]));

I have put all over the methods the DomConfigure statement and a call like
below in a button click event:

DOMConfigurator.Configure();
log.Fatal("write me");

The problem is that I get nothing written to a log file anywhere.  This
code is fine if I am using a windows application and if I use nHibernate in
my app it gets configured correctly but as a standalone web app I am not
getting anything.  I am not even getting an exception coming back.  I have
even tried raising the ASPNET user's rights to "PowerUser" level (in
response to some info in the archives) and this won't get me a log file.
Does anyone know what I am doing incorrectly?

Thank you for you time on this very frustrating matter,


Robin McAninch



Robin McAninch

Russell/Mellon
1 Mellon Bank Centre,
Aim# 1625
Pittsburgh, Pa, 15258
Phone: 412.234.2461
Email: rmcaninch@russellmellon.com