MCPcopy Index your code
hub / github.com/docker/docker-py / logs

Method logs

docker/models/services.py:87–114  ·  view source on GitHub ↗

Get log stream for the service. Note: This method works only for services with the ``json-file`` or ``journald`` logging drivers. Args: details (bool): Show extra details provided to logs. Default: ``False`` follow (bool): Kee

(self, **kwargs)

Source from the content-addressed store, hash-verified

85 )
86
87 def logs(self, **kwargs):
88 """
89 Get log stream for the service.
90 Note: This method works only for services with the ``json-file``
91 or ``journald`` logging drivers.
92
93 Args:
94 details (bool): Show extra details provided to logs.
95 Default: ``False``
96 follow (bool): Keep connection open to read logs as they are
97 sent by the Engine. Default: ``False``
98 stdout (bool): Return logs from ``stdout``. Default: ``False``
99 stderr (bool): Return logs from ``stderr``. Default: ``False``
100 since (int): UNIX timestamp for the logs staring point.
101 Default: 0
102 timestamps (bool): Add timestamps to every log line.
103 tail (string or int): Number of log lines to be returned,
104 counting from the current end of the logs. Specify an
105 integer or ``'all'`` to output all log lines.
106 Default: ``all``
107
108 Returns:
109 generator: Logs for the service.
110 """
111 is_tty = self.attrs['Spec']['TaskTemplate']['ContainerSpec'].get(
112 'TTY', False
113 )
114 return self.client.api.service_logs(self.id, is_tty=is_tty, **kwargs)
115
116 def scale(self, replicas):
117 """

Calls 2

service_logsMethod · 0.80
getMethod · 0.45