Core/Toolbox/IO/File.php
public function exists(LoggerInterface $logger = null): bool
    {
        $filename = $this->replaceDirectorySeperator($this->filename);
        $exists = file_exists($filename);

        if (!$exists && isset($logger)) {
            $logger->notice(sprintf('File "%s" not found.', $filename));
        }

        return $exists;
    }
public function exists(LoggerInterface $logger = null): bool
    {
        $filename = $this->replaceDirectorySeperator($this->filename);
        $exists = file_exists($filename);

        if (!$exists && isset($logger)) {
            $logger->notice(sprintf('File "%s" not found.', $filename));
        }

        return $exists;
    }
Wrapper method for file_exists() plus logging feature

@param string $filename
Complete path to file
@param LoggerInterface $logger
Optional logger component to track notices when file does not exist

@return boolean