Skip to content

Commit

Permalink
Support getting container output from local logging driver
Browse files Browse the repository at this point in the history
The `local` [Docker logging driver](https://docs.docker.com/config/containers/logging/local/) is a new-ish, optimized local logging driver that improves upon json-file. Since logs written using `local` can still be accessed through the Docker daemon API, all that is needed here is to add to the supported list.
  • Loading branch information
srstsavage committed Apr 24, 2022
1 parent e12a487 commit fd09e4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fd09e4a

Please sign in to comment.