Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'local' to list of logging drivers that support docker-compose logs #7425

Merged
merged 2 commits into from
Aug 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compose/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def log_driver(self):
@property
def has_api_logs(self):
log_type = self.log_driver
return not log_type or log_type in ('json-file', 'journald')
return not log_type or log_type in ('json-file', 'journald', 'local')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly related; looks like the description here also needs updating;

"""A log stream can only be attached if the container uses a json-file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip. Updated the comment.


@property
def human_readable_health_status(self):
Expand All @@ -208,8 +208,8 @@ def human_readable_health_status(self):
return status_string

def attach_log_stream(self):
"""A log stream can only be attached if the container uses a json-file
log driver.
"""A log stream can only be attached if the container uses a
json-file, journald or local log driver.
"""
if self.has_api_logs:
self.log_stream = self.attach(stdout=True, stderr=True, stream=True)
Expand Down