Builds and enables a logger with a logger list of the top-level list of
    installed app modules (based on package name) plus any additional
    application packages passed in - for example, a user may want to log a
    dependent package of one the installed apps.  The logger will write either
    to the console or to a file based on the presence of the filename parameter.
    Check that the LOGGING_CONFIG setting is None before we configure the logger
    in order to prevent maintaining Django's list of log handlers.

def configure_installed_apps_logger(level, verbose=False,
                                    additional_packages=None, filename=None):
    """Builds and enables a logger with a logger list of the top-level list of
    installed app modules (based on package name) plus any additional
    application packages passed in - for example, a user may want to log a
    dependent package of one the installed apps.  The logger will write either
    to the console or to a file based on the presence of the filename parameter.
    Check that the LOGGING_CONFIG setting is None before we configure the logger
    in order to prevent maintaining Django's list of log handlers."""
    if settings.LOGGING_CONFIG:
        raise ImproperlyConfigured(LOGGING_CONFIG_ERROR_MSG)

    app_set = _normalize_apps(settings.INSTALLED_APPS)
    # Add any additional app modules to the set of apps we want to configure
    if additional_packages:
        # Make sure we're dealing with a list of additional apps before we
        # convert to a set
        if not isinstance(additional_packages, list):
            additional_packages = list(additional_packages)
        # Update the app set with these additional app modules
        app_set.update(set(additional_packages))

    config = _build_logging_config(
        level, app_set, verbose, filename)

    logging.config.dictConfig(config)