title: Force log4net logging level
body: <p>It turns out that one of my colleagues has disabled the logging level check in the source code:</p>
  
  <pre><code>private static void Log(string source, EnumLogType logType, string msg)
      {
          ....
  
          switch (logType)
          {
              case EnumLogType.ERROR:
                  //if (log.IsErrorEnabled) { log.Error(logMsg); }
                  log.Error(logMsg);
                  break;
              case EnumLogType.WARNING:
                  //if (log.IsWarnEnabled) { log.Warn(logMsg); }
                  log.Warn(logMsg); 
                  break;
              case EnumLogType.INFO:
                  //if (log.IsInfoEnabled) { log.Info(logMsg); }
                  log.Info(logMsg); 
                  break;
              case EnumLogType.VERBOSE:
                  //if (log.IsDebugEnabled) { log.Debug(logMsg); }
                  log.Debug(logMsg); 
                  break;
              default:
                  log.Debug(logMsg);
                  break;
          }
      }
  </code></pre>
  
  <p>So our product is now writing debug logs even though the level in the configuration file is set to ERROR.</p>
  
  <p>Is there any way to force log4net to log only Error messages? In other words, can I force log4net to check the logging level by configuring it and without editing and recompiling the source code?</p>