title: Log4net logs several times same line since MinimalLock setup
body: <p>I recently had to face some performance issues on my C# program and find out that <code>log4net</code> was the origin of those problems. I changed the configuration adding the <code>MinimalLock</code> and it really helped a lot.</p>
  
  <p>This is how I have now configured my log4net:</p>
  
  <pre><code>var hierarchy = (Hierarchy)log4net.LogManager.GetRepository();
  
  var patternLayout = new PatternLayout();
  patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline";
  patternLayout.ActivateOptions();
  
  var roller = new RollingFileAppender();
  
  roller.LockingModel = new FileAppender.MinimalLock();
  roller.LockingModel.ActivateOptions();
  
  roller.Encoding = System.Text.Encoding.UTF8;
  roller.AppendToFile = true;
  roller.File = Path.Combine(Logger.LogPath, "log.txt");
  roller.Layout = patternLayout;
  roller.MaxSizeRollBackups = 5;
  roller.MaximumFileSize = "100MB";
  roller.RollingStyle = RollingFileAppender.RollingMode.Size;
  roller.StaticLogFileName = true;
  roller.ActivateOptions();
  
  hierarchy.Root.AddAppender(roller);
  hierarchy.Root.Level = Level.Debug;
  hierarchy.Configured = true;
  </code></pre>
  
  <p>The drawback from this is that now my logs contain the very same log lines repeated many times. </p>
  
  <p>I suspect that I misunderstood something from the log4net configuration and now each log line I want to output is sent as much times as processes the application has (even, obviously, the rest of processes created are not logging anything, or at least not the same line at the same time!)</p>
  
  <p>Here an example of log line:</p>
  
  <blockquote>
    <p>2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,495 [1] DEBUG MetryViewModel - Reading dat: manuel.dat with config: None
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol<br>
    2016-11-18 10:35:34,512 [1] INFO  ViewModel - Operating mode: Lol       </p>
  </blockquote>