Skip to content

Update awslogs.md#3319

Merged
mdlinville merged 2 commits intodocker:masterfrom
mixja:awslogs_multiline_logging
Jun 26, 2017
Merged

Update awslogs.md#3319
mdlinville merged 2 commits intodocker:masterfrom
mixja:awslogs_multiline_logging

Conversation

@mixja
Copy link
Copy Markdown
Contributor

@mixja mixja commented May 18, 2017

Signed-off-by: Justin Menga justin.menga@gmail.com

Proposed changes

Add documentation for new AWS CloudWatch logs multiline pattern options

Unreleased project version

Docker Engine 17.06

Related issues

moby/moby#30891

@mdlinville
Copy link
Copy Markdown

@nathanleclaire @FrenchBen @friism PTAL

@mdlinville mdlinville added area/engine Issue affects Docker engine/daemon Tech Review: Needed labels May 23, 2017
Copy link
Copy Markdown

@nrdlngr nrdlngr left a comment

Choose a reason for hiding this comment

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

Hi, and thanks for your contribution. Would you mind making the following suggested changes to your documentation?

Comment thread engine/admin/logging/awslogs.md Outdated

### awslogs-multiline-pattern

The `awslogs-multiline-pattern` specifies a regular expression pattern for identifying the start of a log message. A log message is made of a line that matches the pattern and any following lines that don't match the pattern.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The awslogs-multiline-pattern specifies a regular expression pattern for identifying the beginning of a container log entry. Any following lines that do not match the pattern are considered to be part of the current log entry. The next line that matches the pattern begins a new log entry.

Comment thread engine/admin/logging/awslogs.md Outdated
> **Note**:
> Multiline logging performs regular expression parsing and matching of all log messages, which may have a negative impact on logging performance.

For example, to process the following log stream where new log messages start with the pattern `INFO`:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For example, to process the following log stream where new log entries begin with the pattern INFO:

Comment thread engine/admin/logging/awslogs.md Outdated
...
```

Which will generate the following CloudWatch log events:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This configuration would generate the following CloudWatch log entries:

Which will generate the following CloudWatch log events:

```
# First event
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you change "First event", "Second event", and "Third event" to use "entry" instead of event?

Comment thread engine/admin/logging/awslogs.md Outdated

### awslogs-datetime-format

The `awslogs-datetime-format` specifies an [strftime expression pattern](http://strftime.org) for identifying the start of a log message. A log message is made of a line that matches the pattern and any following lines that don't match the pattern.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The awslogs-datetime-format specifies a strftime expression pattern for for identifying the beginning of a container log entry. Any following lines that do not match the pattern are considered to be part of the current log entry. The next line that matches the pattern begins a new log entry.

Comment thread engine/admin/logging/awslogs.md Outdated
> **Note**:
> Multiline logging performs regular expression parsing and matching of all log messages, which may have a negative impact on logging performance.

For example, to process the following log stream where new log messages start with the following timestamps:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For example, to process the following log stream where new log entries begin with the following timestamps:

Comment thread engine/admin/logging/awslogs.md Outdated
[May 01, 2017 19:01:32] Another message was logged
```

An strftime expression of `[%b %d, %Y %H:%M:%S]` can be used:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can use the strftime expression, [%b %d, %Y %H:%M:%S]:

Comment thread engine/admin/logging/awslogs.md Outdated
...
```

Which will generate the following CloudWatch log events:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This configuration would generate the following CloudWatch log entries:

Which will generate the following CloudWatch log events:

```
# First event
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you change "First event", "Second event", and "Third event" to use "entry" instead of event?

Comment thread engine/admin/logging/awslogs.md Outdated
[May 01, 2017 19:01:32] Another message was logged
```

The following strftime codes are supported:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The following strftime codes are supported:

@mixja mixja force-pushed the awslogs_multiline_logging branch from 2f96537 to ff98880 Compare May 27, 2017 20:30
@mixja
Copy link
Copy Markdown
Contributor Author

mixja commented May 27, 2017

@nrdlngr - changes submitted as requested

@mdlinville
Copy link
Copy Markdown

@FrenchBen PTAL or nominate.

@FrenchBen
Copy link
Copy Markdown
Contributor

I think this is more of a review by @samuelkarp - if he's happy with it, I don't see any blockers

Comment thread docker-for-mac/networking.md Outdated
Mac; for example: `sudo ifconfig lo0 alias 10.200.10.1/24`, and make sure that
your service is listening on this address or `0.0.0.0` (ie not `127.0.0.1`).
Then containers can connect to this address.
The Mac has a changing IP address (or none if you have no network access). From
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like an unrelated change.

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

### awslogs-multiline-pattern

Copy link
Copy Markdown
Contributor

@samuelkarp samuelkarp May 31, 2017

Choose a reason for hiding this comment

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

Does this need {% include edge_only.md section="option" %} or did the feature make it into the 17.06.0 RC?

Copy link
Copy Markdown

@mdlinville mdlinville May 31, 2017

Choose a reason for hiding this comment

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

It still needs it even if so, because 17.06 is not released yet. The code is:

{% include edge_only.md section="option" %}

Or maybe "feature" instead of "option" if that fits better. The text is not arbitrary, but there are a few choices, see _inclues/edge_only.md for more info on how it works.

@mdlinville mdlinville force-pushed the awslogs_multiline_logging branch from 0ca55e2 to 09abadd Compare June 19, 2017 19:20
@mdlinville
Copy link
Copy Markdown

I interactive rebased and removed the unrelated commit.

@mdlinville
Copy link
Copy Markdown

This was already addressed in #3615

@mdlinville mdlinville closed this Jun 22, 2017
@samuelkarp
Copy link
Copy Markdown
Contributor

@mstanleyjones It looks like #3615 lost a lot of the content from this one. Is that intentional?

@mdlinville
Copy link
Copy Markdown

Not necessarily, no. I'll review it and see what we need to keep from here. I wasn't focused on this PR when I did the work on that other one.

@mdlinville mdlinville reopened this Jun 22, 2017
mixja added 2 commits June 23, 2017 15:58
Signed-off-by: Justin Menga <justin.menga@gmail.com>
Signed-off-by: Justin Menga <justin.menga@gmail.com>
@mdlinville mdlinville force-pushed the awslogs_multiline_logging branch from 09abadd to 637cb38 Compare June 23, 2017 23:01
@mdlinville
Copy link
Copy Markdown

I'm taking this over to get the important info in here ported over.

@mdlinville mdlinville merged commit b1d32c9 into docker:master Jun 26, 2017
INFO Another message was logged
```

You can use the strftime expression of `[%b %d, %Y %H:%M:%S]`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this line is misplaced. Did you mean to have it say "You can use the regular expression of ^INFO:"?

For example, to process the following log stream where new log messages start with the pattern `INFO`:

Consider the following log stream, where each log message should start with the
patther `INFO`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/patther/pattern/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants