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 AWS logs driver awslogs-create-stream option doc #20928

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions content/manuals/engine/logging/drivers/awslogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@
> Your AWS IAM policy must include the `logs:CreateLogGroup` permission before
> you attempt to use `awslogs-create-group`.

### awslogs-create-stream

Check warning on line 130 in content/manuals/engine/logging/drivers/awslogs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.HeadingSentenceCase] Use sentence case for headings: 'awslogs-create-stream'. Raw Output: {"message": "[Docker.HeadingSentenceCase] Use sentence case for headings: 'awslogs-create-stream'.", "location": {"path": "content/manuals/engine/logging/drivers/awslogs.md", "range": {"start": {"line": 130, "column": 5}}}, "severity": "WARNING"}

By default, the log driver creates the AWS CloudWatch Logs stream used for container log persistence.

Set `awslogs-create-stream` to `false` to disable log stream creation. When disabled, the Docker daemon assumes
the log stream already exists. A use case where this is beneficial is when log stream creation is handled by
another process avoiding redundant AWS CloudWatch Logs API calls.

If disabled and log stream does not exist, then log persistence to CloudWatch will fail during container run time
with `Failed to put log events` error messages in daemon logs.
Comment on lines +138 to +139
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If disabled and log stream does not exist, then log persistence to CloudWatch will fail during container run time
with `Failed to put log events` error messages in daemon logs.
If `awslogs-create-stream` is set to `false` and the log stream does not exist,
log persistence to CloudWatch fails during container runtime, resulting in
`Failed to put log events` error messages in the daemon logs.


```console
$ docker run \
--log-driver=awslogs \
--log-opt awslogs-region=us-east-1 \
--log-opt awslogs-group=myLogGroup \
--log-opt awslogs-stream=myLogStream \
--log-opt awslogs-create-stream=false \
...
```

### awslogs-datetime-format

The `awslogs-datetime-format` option defines a multi-line start pattern in [Python
Expand Down
Loading