magento2 – Create custom import history entry in magento 2

I’m using a custom import products code and i want to add a new import history entry when i use my custom import
and create an error report csv file while imported file is invalid.
Any help please !!

this is my custom import code:

public function importProduct($rowData){

$csvModel = $this->csvFactory->create(('destination' => self::PATH_FILENAME));
$csvModel->writeRow($rowData);

$importModel = $this->importModelFactory->create();

$importModel->setData((
            "entity"=>"catalog_product",
            "behavior"=>"add_update",
            "validation_strategy"=>"validation-stop-on-errors",
            "allowed_error_count"=>"10",
            "_import_field_separator"=>";",
            "_import_multiple_value_separator"=>","
        ));

$sourceModel = MagentoImportExportModelImportAdapter::findAdapterFor(
                self::PATH_FILENAME,
                $this->objectManager->create(MagentoFrameworkFilesystem::class)
                                    ->getDirectoryWrite(MagentoFrameworkAppFilesystemDirectoryList::ROOT),
                $importModel->getData(MagentoImportExportModelImport::FIELD_FIELD_SEPARATOR)
        );

$isValid = $importModel->validateSource($sourceModel);
if ($importModel->getProcessedRowsCount() === 0 || 
    !$isValid || 
    $importModel->getErrorAggregator()->getErrorsCount()
) {
    var_dump($importModel->getErrorAggregator()->getAllErrors());
    exit;
}

try {
    $importModel->importSource();
    echo "sucess import";
} catch (Exception $e) {
    throw new Exception($e->getMessage());
}}