title: log4net isn't logging at start, starts after a little time
body: <p>We've been using log4net in a .net console app. It used to log everything to console and SQL from the first entry. All of a sudden, the logger doesn't write to our SQL until much later, and it's weird, considering:</p>
  
  <pre><code>Logger.Info("my message won't log")
  Logger.Info("my message will log")
  </code></pre>
  
  <p>it won't log the first but logs the second. Appears to happen every time at the same lines of code, still verifying that. I debugged, stopped at the first logger, used immediate window and log a message and that worked. Can't seem to see why. </p>
  
  <p>But all the meanwhile everything is being logged to the console fine!</p>
  
  <p>Thoughts on what could have happened or why?</p>
  
  <p>Code for custom appender</p>
  
  <pre><code>namespace Dsmt.Logging
  {
      public class HistoryPatternLayout : PatternLayout
      {
          public HistoryPatternLayout()
          {
              AddConverter(new ConverterInfo
              {
                  Name = "migrationHistory",
                  Type = typeof(MigrationHistoryConverter)
              });
          }
      }
  
      public class MigrationHistoryConverter : PatternConverter
      {
          protected override void Convert(TextWriter writer, object state)
          {
              if (state == null)
              {
                  writer.Write(SystemInfo.NullText);
                  return;
              }
              var loggingEvent = state as LoggingEvent;
              var historyInfo = loggingEvent!= null ? loggingEvent.MessageObject as HistoryLoggerInfo : null;
              if (historyInfo == null)
              {
                  writer.Write(SystemInfo.NullText);
                  return;
              }
              switch (this.Option.ToLower())
              {
                  case "migrationhistoryid" :
                      writer.Write(historyInfo.MigrationHistoryId);
                      break;
                  case "itemid" :
                      writer.Write(historyInfo.ItemID);
                      break;
                  case "success" :
                      writer.Write(historyInfo.Success);
                      break;
                  case "message" :
                      writer.Write(historyInfo.Message);
                      break;
                  case "itemdatetime" :
                      writer.Write(historyInfo.ItemDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                      break;
                  case "newlocation":
                      writer.Write(historyInfo.NewLocation);
                      break;
  
                  default :
                      writer.Write(SystemInfo.NullText);
                      break;
              }
          }
      }
  
      public class HistoryLoggerInfo
      {
          public string MigrationHistoryId { get; set; }
          public string ItemID { get; set; }
          public bool Success { get; set; }
          public string Message { get; set; }
          public DateTime ItemDateTime { get; set; }
  
          public string NewLocation { get;set; }
  
          public override string ToString()
          {
              var serializeObject = JsonConvert.SerializeObject(this);
              //var serializeObject = JsonConvert.SerializeObject(this, new Log4NetDateTimeConverter());
              return serializeObject;
          }
  
          public class Log4NetDateTimeConverter : DateTimeConverterBase
          {
              public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
              {
                  writer.WriteValue(((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss.fff"));
              }
  
              public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
              {
                  return DateTime.Now.AddYears(-13);
              }
          }
      }
  
  }
  </code></pre>