logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cijojohn <cijoj...@gmail.com>
Subject Logging not happening when run on IIS using log4net
Date Thu, 24 Sep 2009 18:18:58 GMT

I’m using an ASP.net web application, in that I’m using log4net for logging.
When I run the project, in the ASP.net development server, I’m able to log
the logger statements.
But when the application is run on IIS no logging happens. My application is
set as a virtual directory inside a Asp web application.

Below is my setting in webconfig.
            <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
    <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
                  <!-- Please make shure the ..\\Logs directory exists! -->
                  <layout type="log4net.Layout.PatternLayout">
            <appender name="SmtpAppender"
                  <to value=""/>
                  <from value=""/>
                  <subject value=""/>
                  <smtpHost value=""/>
                  <bufferSize value="512"/>
                  <lossy value="true"/>
                  <evaluator type="log4net.Core.LevelEvaluator">
                        <threshold value="WARN"/>
                  <layout type="log4net.Layout.PatternLayout">
                        <conversionPattern value="%newline%date [%thread]
%-5level %logger [%property] - %message%newline%newline%newline"/>
            <logger name="File">
                  <level value="All"/>
                  <appender-ref ref="LogFileAppender"/>
            <logger name="EmailLog">
                  <level value="All"/>
                  <appender-ref ref="SmtpAppender"/>
In my appication start I’m using the following code

protected void Application_Start(object sender, EventArgs e)
My C# class is as follows.

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using log4net;
namespace SEAIWedgeSizing.Pages
    public partial class SizingMaster : System.Web.UI.Page

        private ILog logger = LogManager.GetLogger("File");
        protected void Page_Load(object sender, EventArgs e)
            logger.Debug("**** Entering  Class - SizingMaster :: Method -
Page_Load ********");

Are there any seetings in IIS?
View this message in context: http://www.nabble.com/Logging-not-happening-when-run-on-IIS-using-log4net-tp25578031p25578031.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.

View raw message