package org.apache.logging.log4j.core;

import java.util.EventListener;
import org.apache.logging.log4j.LogManager;

public class LogEventListener implements EventListener {
   private final LoggerContext context = (LoggerContext)LogManager.getContext(false);

   protected LogEventListener() {
   }

   public void log(LogEvent event) {
      if (event != null) {
         Logger logger = this.context.getLogger(event.getLoggerName());
         if (logger.config.filter(event.getLevel(), event.getMarker(), event.getMessage(), event.getThrown())) {
            logger.config.logEvent(event);
         }

      }
   }
}
