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

      if ( loggingObject == null || ( loggingObject.getObjectType() == GENERAL && "Y".equals( EnvUtil.getSystemProperty( Const.KETTLE_LOG_GENERAL_OBJECTS_TO_DI_LOGGER ) ) ) ) {
        // 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() == TRANS || loggingObject.getObjectType() == STEP || loggingObject.getObjectType() == DATABASE  ) {
        logToLogger( transLogger, message.getLevel(), loggingObject, message );
      } else if ( loggingObject.getObjectType() == JOB || loggingObject.getObjectType() == JOBENTRY ) {
        logToLogger( jobLogger, message.getLevel(), loggingObject, message );
      }
    }
  }
@Test
  public void testAddLogEventTrans() {
    when( logObjProvider.apply( logChannelId ) ).thenReturn( loggingObject );
    when( loggingObject.getObjectType() ).thenReturn( LoggingObjectType.TRANS );
    when( loggingObject.getFilename() ).thenReturn( "filename" );
    when( message.getLevel() ).thenReturn( LogLevel.BASIC );
    listener.eventAdded( logEvent );


    verify( transLogger ).info( "[filename]  " + msgText );
    when( message.getLevel() ).thenReturn( LogLevel.ERROR );
    listener.eventAdded( logEvent );
    verify( transLogger ).error( "[filename]  " + msgText );
    verifyNoInteractions( diLogger );
    verifyNoInteractions( jobLogger );
  }