class Slf4jLoggingEventListener implements IHopLoggingEventListener {

  @Override
  public void eventAdded( HopLoggingEvent event ) {
    Object messageObject = event.getMessage();
    checkNotNull( messageObject, "Expected log message to be defined." );
    if ( messageObject instanceof LogMessage ) {
      LogMessage message = (LogMessage) messageObject;
      ILoggingObject loggingObject = logObjProvider.apply( message.getLogChannelId() );

      if ( loggingObject == null ) {
        // this can happen if logObject has been discarded while log events are still in flight.
        logToLogger( diLogger, message.getLevel(),
          message.getSubject() + " " + message.getMessage() );
      } else if ( loggingObject.getObjectType() == PIPELINE || loggingObject.getObjectType() == TRANSFORM || loggingObject.getObjectType() == DATABASE ) {
        logToLogger( pipelineLogger, message.getLevel(), loggingObject, message );
      } else if ( loggingObject.getObjectType() == WORKFLOW || loggingObject.getObjectType() == ACTION ) {
        logToLogger( jobLogger, message.getLevel(), loggingObject, message );
      }
    }
  }

  public  Slf4jLoggingEventListener();

}