diff --git a/changelogs/fragments/337-container-output-from-local-logging-driver.yml b/changelogs/fragments/337-container-output-from-local-logging-driver.yml new file mode 100644 index 000000000..0b07db8f1 --- /dev/null +++ b/changelogs/fragments/337-container-output-from-local-logging-driver.yml @@ -0,0 +1,2 @@ +minor_changes: + - "Support returning docker container log output when using Docker's `local` logging driver, an optimized local logging driver introduced in Docker 18.09." diff --git a/plugins/modules/docker_container.py b/plugins/modules/docker_container.py index 78c1d061a..6d155294c 100644 --- a/plugins/modules/docker_container.py +++ b/plugins/modules/docker_container.py @@ -3142,7 +3142,7 @@ def container_start(self, container_id): config = self.client.inspect_container(container_id) logging_driver = config['HostConfig']['LogConfig']['Type'] - if logging_driver in ('json-file', 'journald'): + if logging_driver in ('json-file', 'journald', 'local'): output = self.client.logs(container_id, stdout=True, stderr=True, stream=False, timestamps=False) if self.parameters.output_logs: self._output_logs(msg=output)