'Ensure that the configured Docker logging driver matches fluentd settings.
This means that, at least for now, if the following condition is met:
openshift_logging_fluentd_use_journal == True
then the value of the configured Docker logging driver should be "journald".
Otherwise, the value of the Docker logging driver should be "json-file".
Returns an error string if the above condition is not met, or None otherwise.'

def check_logging_config(self):

    use_journald = self.get_var('openshift_logging_fluentd_use_journal', default=True)
    group_names = self.get_var('group_names')
    if ('masters' in group_names):
        use_journald = self.check_fluentd_env_var()
    docker_info = self.execute_module('docker_info', {})
    try:
        logging_driver = docker_info['info']['LoggingDriver']
    except KeyError:
        return 'Unable    to    determine    Docker    logging    driver.'
    logging_driver = docker_info['info']['LoggingDriver']
    recommended_logging_driver = 'journald'
    error = None
    if (use_journald and (logging_driver != 'journald')):
        error = 'Your    Fluentd    configuration    is    set    to    aggregate    Docker    container    logs    from    "journald".\nThis    differs    from    your    Docker    configuration,    which    has    been    set    to    use    "{driver}"    as    the    default    method    of    storing    logs.\nThis    discrepancy    in    configuration    will    prevent    Fluentd    from    receiving    any    logsfrom    your    Docker    containers.'.format(driver=logging_driver)
    elif ((not use_journald) and (logging_driver != 'json-file')):
        recommended_logging_driver = 'json-file'
        error = 'Your    Fluentd    configuration    is    set    to    aggregate    Docker    container    logs    from    individual    json    log    files    per    container.\n    This    differs    from    your    Docker    configuration,    which    has    been    set    to    use    "{driver}"    as    the    default    method    of    storing    logs.\nThis    discrepancy    in    configuration    will    prevent    Fluentd    from    receiving    any    logsfrom    your    Docker    containers.'.format(driver=logging_driver)
    if error:
        error += '\nTo    resolve    this    issue,    add    the    following    variable    to    your    Ansible    inventory    file:\n\n        openshift_docker_options="--log-driver={driver}"\n\nAlternatively,    you    can    add    the    following    option    to    your    Docker    configuration,    located    in"/etc/docker/daemon.json":\n\n{{    "log-driver":    "{driver}"    }}\n\nSee    https://docs.docker.com/engine/admin/logging/json-file    for    more    information.'.format(driver=recommended_logging_driver)
    return error
