title: How to mock log4j2 logger object using slf4j in Junit
body: <p>I have below code where I am creating different log4j2 loggers object using slf4j factory and I need to write to specific log file based on input param.</p>
  
  <pre><code>@Service
  class WriterService {
  
  val logger1: Logger = LoggerFactory.getLogger("t_logger")
  val logger2: Logger = LoggerFactory.getLogger("b_logger")
  val labelKey = "Label"
  
  fun writeLog(payload: Map&lt;String, Any&gt;){
  
      if(payload.containsKey(labelKey)) {
  
          val label = payload[labelKey].toString().toLowerCase()
  
          if (label == "t") {
              logger1.info("{}", payload)
  
          } else if (label == "b") {
              logger2.info("{}", payload)
          }
      }
  }
  </code></pre>
  
  <p>I am wondering how can I mock Logger objects using MockitoJUnitRunner so that I can mock which logger object was invoked ?</p>