Avoiding entity-type errors on module installation
I've revised my approach here several times, but so far the cleanest solution in my opinion is:

Store the entity_type.manager service, not the storage. When the storage is used, place the whole chain $this-&gt;manager-&gt;getStorage()-&gt;loadMultiple() into a try/catch.

This avoids having to handle the special case in two places: Once in the constructor (when acquiring the storage might fail), and again in the loading function (when the storage might not exist, because it failed in the constructor).

&lt;?php

namespace Drupal\dblog_persistent\Logger;

use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\ConfigEntityStorage;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Logger\LogMessageParserInterface;
use Drupal\dblog\Logger\DbLog;
use Drupal\dblog_persistent\DbLogPersistentStorageInterface;

/**
 * Class DbLogPersistent
 *
 * @package Drupal\dblog_persistent\Logger
 */
class DbLogPersistent extends DbLog {

  /**
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $manager;

  /**
   * @var \Drupal\dblog_persistent\DbLogPersistentStorageInterface
   */
  protected $storage;

  /**
   * @var \Drupal\dblog_persistent\Entity\ChannelInterface[]
   */
  private $channels;

  public function __construct(Connection $connection,
                              LogMessageParserInterface $parser,
                              EntityTypeManagerInterface $manager,
                              DbLogPersistentStorageInterface $storage) {
    parent::__construct($connection, $parser);
    $this-&gt;manager = $manager;
    $this-&gt;storage = $storage;
  }

  protected function getChannels() {
    if ($this-&gt;channels === NULL) {
      try {
        $this-&gt;channels = $this-&gt;manager
          -&gt;getStorage('dblog_persistent_channel')
          -&gt;loadMultiple();
      }
      catch (PluginNotFoundException $e) {
        $this-&gt;channels = [];
      }
    }
    return $this-&gt;channels;
  }
}