Skip to content

Cross platform redirect the access_log output to (stderr/stdout)#15202

Closed
davinci26 wants to merge 48 commits intoenvoyproxy:mainfrom
davinci26:accesslogtype
Closed

Cross platform redirect the access_log output to (stderr/stdout)#15202
davinci26 wants to merge 48 commits intoenvoyproxy:mainfrom
davinci26:accesslogtype

Conversation

@davinci26
Copy link
Copy Markdown
Member

@davinci26 davinci26 commented Feb 26, 2021

Commit Message:
Fixes: #13964

Additional Description:

  • Make the CI happy
  • Add integration tests
  • Cleanup random format changes
  • Windows implementation
  • Doc changes
  • Release notes

Risk Level: Medium
Testing: Unit/Integration and Manual validation
Docs Changes: Completed
Release Notes: add access_log_destination property to FileAccessLog to write to standard streams in a cross platform way.
Platform Specific Features: N/A

Sotiris Nanopoulos added 2 commits February 25, 2021 15:58
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
API shepherd assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #15202 was opened by davinci26.

see: more, trace.

@davinci26
Copy link
Copy Markdown
Member Author

davinci26 commented Feb 26, 2021

Mostly a WiP, my VM can't compile and run all the tests so I have to iterate over the CI a bit. Will update when its ready for a review

Sotiris Nanopoulos added 11 commits February 25, 2021 18:04
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Sotiris Nanopoulos added 3 commits March 1, 2021 11:01
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Sotiris Nanopoulos added 2 commits March 1, 2021 15:35
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
@davinci26
Copy link
Copy Markdown
Member Author

@antoniovicente @jmarantz since both of you were involved in the discussions, do you want to do the code review?

"envoy.config.accesslog.v2.FileAccessLog";

// A path to a local file to which to write the access log entries.
string path = 1 [(validate.rules).string = {min_len: 1}];
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The reason we don't wrap these two properties into a struct and make them oneof is to maintain backwards compatibility

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stepping back for a sec, do you think it makes sense for a "file access log" to output to console, stderr, stdout, etc.? Or should we have ConsoleAccessLog, StderrAccessLog, StdoutAccessLog?

If we think putting this functionality in FileAccessLog makes sense, here is what I would suggest:

  1. Deprecate path
  2. Add a new oneof "output_type" or similar
  3. Define a new message for each option: Path, Console, Stderr, Stdout (this allows for future extensibility)

I would then use ^ in the admin proto (and deprecate path their as well and/or potentially even allow loading full access log extensions so we can instantiate grpc access log, file access log, etc.). It's unfortunate that admin is not a full listener but that is a well known issue and I'm not suggesting we fix that here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like the idea of creating ConsoleAccessLog, StderrAccessLog, StdoutAccessLog and using it everywhere.

Can I deprecate the path in admin and replace it with a config_type that accepts on of the configs above? Or I can just add the config_type property in admin.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What I would do is deprecate path in admin and actually make it a repeated list of access log extensions the same as we use elsewhere. You will see it will be trivial to wire up in the fake admin listener.

Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
@antoniovicente antoniovicente self-assigned this Mar 2, 2021
Sotiris Nanopoulos added 12 commits March 5, 2021 08:56
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
@davinci26
Copy link
Copy Markdown
Member Author

davinci26 commented Mar 8, 2021

@antoniovicente I did some updates, added docs and expect the CI to go green. Feel free to take another look when you get some time.

Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Copy link
Copy Markdown
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Looks great, just a few nits and some small requests for additional tests.

Sotiris Nanopoulos added 2 commits March 8, 2021 17:00
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
antoniovicente
antoniovicente previously approved these changes Mar 10, 2021
Copy link
Copy Markdown
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Looks great.

@mattklein123 off to you for API review.

@davinci26
Copy link
Copy Markdown
Member Author

thanks for the thoughtful review @antoniovicente

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Very cool. I'm sorry to have not looked at this sooner, but some high level API comments to discuss. Thank you.

/wait

"envoy.config.accesslog.v2.FileAccessLog";

// A path to a local file to which to write the access log entries.
string path = 1 [(validate.rules).string = {min_len: 1}];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stepping back for a sec, do you think it makes sense for a "file access log" to output to console, stderr, stdout, etc.? Or should we have ConsoleAccessLog, StderrAccessLog, StdoutAccessLog?

If we think putting this functionality in FileAccessLog makes sense, here is what I would suggest:

  1. Deprecate path
  2. Add a new oneof "output_type" or similar
  3. Define a new message for each option: Path, Console, Stderr, Stdout (this allows for future extensibility)

I would then use ^ in the admin proto (and deprecate path their as well and/or potentially even allow loading full access log extensions so we can instantiate grpc access log, file access log, etc.). It's unfortunate that admin is not a full listener but that is a well known issue and I'm not suggesting we fix that here.

Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
@davinci26
Copy link
Copy Markdown
Member Author

Closing to break it down into two PRs

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Windows) Cannot Redirect the access_log output to (stderr/stdout/null)

3 participants