logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ori - Gmail" <oor...@gmail.com>
Subject what's wrong with my application?
Date Tue, 17 Oct 2006 08:49:17 GMT
I wrote a very simple c# application to try writing to log file, and it
doesn't work. The log stays empty.

Can someone please tell me why?

 

The application code:

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using log4net;

using log4net.Appender;

 

namespace Log4netTry

{

    public partial class Form1 : Form

    {        

        static ILog log;

        public Form1()

        {

            InitializeComponent();

            FileAppender f = new FileAppender();

            f.ImmediateFlush = true;            

            f.File = "text.log";

            f.ActivateOptions();

            log4net.Config.BasicConfigurator.Configure(f);

            log = LogManager.GetLogger("MyLog");                        

        }

 

        private void Form1_Load(object sender, EventArgs e)

        {

            log.Error("Moony");

            log.Debug("ddsdsds");            

        }

    }

}


Mime
View raw message