Search code examples
c#log4net

log4net not logging/creating log file


I am trying to use, for logging for a c# console app that I created. It doesn't seem to work for some reason , or I am not sure what I missed. Any help ?

log4net.config

Program.cs

using System;

  [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]

  public class SearchCardsML
   {

      private static readonly log4net.ILog logger = 
                        log4net.LogManager.GetLogger
          (System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
      public static void Main(string[] args)
      {
          logger.Info("Started....");
      }
 
    }

Project Tree


Solution

  • I forgot to use 'Copy Always' settings, i really dont understand how this impacted from creating logs , but it works now