Skip to content

Commit

Permalink
Update documentation for CreateLogGroup support in awslogs (docker#1423)
Browse files Browse the repository at this point in the history
* Update documentation for CreateLogGroup support in awslogs

This fix updates the documetation for CreateLogGroup support in awslogs

This fix is related to
moby/moby#29334
moby/moby#29504

Signed-off-by: Yong Tang <[email protected]>

* Improved line wrapping of code block
  • Loading branch information
yongtang authored and Misty Stanley-Jones committed Apr 6, 2017
1 parent 786555a commit 5d225d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions engine/admin/logging/awslogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ specified, the container ID is used as the log stream.
> at a time. Using the same log stream for multiple containers concurrently
> can cause reduced logging performance.
### awslogs-create-group

Log driver will return an error by default if the log group does not exist. However, you can set the
`awslogs-create-group` to `true` to automatically create the log group as needed.
The `awslogs-create-group` option defaults to `false`.

```bash
$ docker run --log-driver=awslogs \
--log-opt awslogs-region=us-east-1 \
--log-opt awslogs-group=myLogGroup \
--log-opt awslogs-create-group=true \
...
```

> **Note:**
> Your AWS IAM policy must include the `logs:CreateLogGroup` permission before you attempt to use `awslogs-create-group`.
### tag

Specify `tag` as an alternative to the `awslogs-stream` option. `tag` interprets template markup (e.g., `{% raw %}{{.ID}}{% endraw %}`, `{% raw %}{{.FullID}}{% endraw %}` or `{% raw %}{{.Name}}{% endraw %}` `{% raw %}docker.{{.ID}}{% endraw %}`).
Expand Down
2 changes: 2 additions & 0 deletions engine/admin/logging/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ The `awslogs` supports the following options:
| `awslogs-region` | Sets the region where the logs are sent. If not set, the container's region is used. | `--log-opt awslogs-region=us-east-1` |
| `awslogs-group` | The log group to use for the logs. | `--log-opt awslogs-group=myLogGroup` |
| `awslogs-stream` | The log stream to use. If not specified, the container ID is used as the log stream. | `--log-opt awslogs-stream=myLogStream` |
| `awslogs-create-group` | If the option is set to true, create the log group if the log group does not exist yet. | `--log-opt awslogs-create-group=true` |

### Examples

Expand All @@ -314,6 +315,7 @@ $ docker run \
--log-driver=awslogs \
--log-opt awslogs-region=us-east-1 \
--log-opt awslogs-group=myLogGroup \
--log-opt awslogs-create-group=true \
alpine sh
```

Expand Down

0 comments on commit 5d225d3

Please sign in to comment.