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:12:30 UTC

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

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


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

Posted by DW...@strohlsystems.com.
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




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

Posted by Ron Grabowski <ro...@yahoo.com>.
Log4net is designed to not throw exceptions. You application should
continue to work even if someone is wrong with log4net.

What happens when you enable internal debugging?

http://logging.apache.org/log4net/release/faq.html#internalDebug

http://tinyurl.com/e3ued
http://www.mail-archive.com/log4net-user%40logging.apache.org/msg02159.html

The problem you described is usually caused by the ASP.Net process not
having correct write permissions to the directory.

Since you're using an ASP.Net application, you could try testing
log4net by setting up a AspNetTraceAppender and viewing the Trace.axd
for your application inside your browser.

--- "McAninch, Robin" <RM...@russellmellon.com> wrote:

> 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