Skip to content

application_logs: add bootstrap option to set log format#27816

Merged
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
ohadvano:ohadvano/text_app_log
Jun 8, 2023
Merged

application_logs: add bootstrap option to set log format#27816
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
ohadvano:ohadvano/text_app_log

Conversation

@ohadvano
Copy link
Contributor

@ohadvano ohadvano commented Jun 6, 2023

Commit Message: application_logs: add bootstrap option to set log format
Additional Description: Related to #27278 which adds a bootstrap option to set JSON log format. Resolves #27761
Risk Level: Low
Testing: Unit tests
Docs Changes: Changelog
Release Notes: None
Platform Specific Features: None

Signed-off-by: ohadvano <ohadvano@gmail.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #27816 was opened by ohadvano.

see: more, trace.

Copy link
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.

Thanks for adding this. One question.

/wait-any

Comment on lines +41 to +42
if (application_log_config.log_format().has_text_format()) {
Logger::Registry::setLogFormat(application_log_config.log_format().text_format());
Copy link
Member

Choose a reason for hiding this comment

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

What happens if someone sets the CLI option? I think this is similar to the other convo we had? Should we have an error if someone sets the CLI option and then sets the bootstrap option? I admit that perhaps there is a use case where someone could set the log format before the bootstrap is read, but that seems like kind of an edge case and we could just see if anyone complains about that? wdyt?

Copy link
Contributor Author

@ohadvano ohadvano Jun 8, 2023

Choose a reason for hiding this comment

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

I agree - if we decided to follow some pattern then I think it should be applied to all cases.
The exclusive format method assertion function is called before stepping into this function, in:

Utility::assertExclusiveLogFormatMethod(options_, bootstrap_.application_log_config());

So this case should be covered, and any other log format that would be added in the future.

Copy link
Member

Choose a reason for hiding this comment

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

OK thanks

Copy link
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.

Thanks

@mattklein123 mattklein123 merged commit 08dd6fe into envoyproxy:main Jun 8, 2023
@ohadvano ohadvano deleted the ohadvano/text_app_log branch June 8, 2023 14:35
asheryerm pushed a commit to asheryerm/envoy that referenced this pull request Jul 5, 2023
…27816)

add bootstrap option to set log format

Signed-off-by: ohadvano <ohadvano@gmail.com>
Signed-off-by: asheryer <asheryer@amazon.com>
reskin89 pushed a commit to reskin89/envoy that referenced this pull request Jul 11, 2023
…27816)

add bootstrap option to set log format

Signed-off-by: ohadvano <ohadvano@gmail.com>
Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
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.

Support free textual log format in bootstrap config

2 participants