<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attach_log_stream(self):
 """A log stream can only be attached if the container uses a json-file log driver. """

        if self.has_api_logs:
            self.log_stream = self.attach(stdout=True, stderr=True, stream=True)