MCPcopy Create free account
hub / github.com/docker/docker-py / logs

Method logs

docker/models/containers.py:293–322  ·  view source on GitHub ↗

Get logs from this container. Similar to the ``docker logs`` command. The ``stream`` parameter makes the ``logs`` function return a blocking generator you can iterate over to retrieve log output as it happens. Args: stdout (bool): Get ``STDOUT``. Defaul

(self, **kwargs)

Source from the content-addressed store, hash-verified

291 return self.client.api.kill(self.id, signal=signal)
292
293 def logs(self, **kwargs):
294 """
295 Get logs from this container. Similar to the ``docker logs`` command.
296
297 The ``stream`` parameter makes the ``logs`` function return a blocking
298 generator you can iterate over to retrieve log output as it happens.
299
300 Args:
301 stdout (bool): Get ``STDOUT``. Default ``True``
302 stderr (bool): Get ``STDERR``. Default ``True``
303 stream (bool): Stream the response. Default ``False``
304 timestamps (bool): Show timestamps. Default ``False``
305 tail (str or int): Output specified number of lines at the end of
306 logs. Either an integer of number of lines or the string
307 ``all``. Default ``all``
308 since (datetime, int, or float): Show logs since a given datetime,
309 integer epoch (in seconds) or float (in nanoseconds)
310 follow (bool): Follow log output. Default ``False``
311 until (datetime, int, or float): Show logs that occurred before
312 the given datetime, integer epoch (in seconds), or
313 float (in nanoseconds)
314
315 Returns:
316 (generator of bytes or bytes): Logs from the container.
317
318 Raises:
319 :py:class:`docker.errors.APIError`
320 If the server returns an error.
321 """
322 return self.client.api.logs(self.id, **kwargs)
323
324 def pause(self):
325 """

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected