Repository navigation
admin: Change multiple log levels at once - #19868
Conversation
|
Hi @timonwong, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
Signed-off-by: Tianpeng Wang <[email protected]>
d11ea58 to
ba441db
Compare
|
Need maintainer to trigger CI. /cc @envoyproxy/first-pass-reviewers |
ff23dee to
47a0cbc
Compare
Signed-off-by: Tianpeng Wang <[email protected]>
40b6d5d to
98f91f9
Compare
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Tianpeng Wang <[email protected]>
98f91f9 to
6d69969
Compare
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Tianpeng Wang <[email protected]>
|
/wait |
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
|
I have to rebase due to DCO, from commit 9f2ff56 |
256d7e3 to
8e33b45
Compare
Signed-off-by: Tianpeng Wang <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Tianpeng Wang <[email protected]>
37ff448 to
384224f
Compare
jmarantz
left a comment
There was a problem hiding this comment.
Thanks for doing all this! I left notes on a few minor nits. I'll pass this off to senior maintainers.
/assign-from @envoyproxy/senior-maintainers
|
|
||
| void LogsHandler::changeAllLogLevels(spdlog::level::level_enum level) { | ||
| if (!Logger::Context::useFancyLogger()) { | ||
| ENVOY_LOG(debug, "change all log levels: level='{}'", spdlog::level::level_string_views[level]); |
There was a problem hiding this comment.
Scanning over the file at HEAD it's not consistent. Can you make all the similar messages be the same level? I'd go for debug for now:
envoy/source/server/admin/logs_handler.cc
Line 102 in 443e582
envoy/source/server/admin/logs_handler.cc
Line 105 in 443e582
| namespace { | ||
|
|
||
| // NOLINTNEXTLINE(readability-identifier-naming) | ||
| std::string ContentType(const BufferingStreamDecoderPtr& response) { |
There was a problem hiding this comment.
rename to contentType and drop the lint override. Also it could return a string_view rather than copying into a string.
I realize you are just moving the pre-existing code but it's being looked at through a new lens of code standards and lint tools :)
thanks :)
| EXPECT_EQ(getFancyContext().getFancyLogEntry(__FILE__)->level(), spdlog::level::info); | ||
|
|
||
| // Test multiple log levels at once | ||
| std::string file = "xxxx_test_logger_file_xxxx"; |
|
@envoyproxy/senior-maintainers assignee is @mattklein123 |
| 1. `POST /logging`: List all names (i.e. file paths) of all active loggers and their levels; | ||
| 2. `POST /logging?<file_path>=<level>`: Given the current file path, change the log level of the file; | ||
| 3. `POST /logging?level=<level>`: Change levels of all loggers. | ||
| 3. `POST /logging?paths=file_path1:level1,file_path2:level2...`: Change log level of multiple file paths at once; |
There was a problem hiding this comment.
should this also be documented in the non-fancy-logger doc?
mattklein123
left a comment
There was a problem hiding this comment.
Thanks LGTM at a high level with some very small comments.
/wait
|
|
||
| void LogsHandler::changeAllLogLevels(spdlog::level::level_enum level) { | ||
| if (!Logger::Context::useFancyLogger()) { | ||
| ENVOY_LOG(debug, "change all log levels: level='{}'", spdlog::level::level_string_views[level]); |
There was a problem hiding this comment.
I think log level change notifications at info level is reasonable so people can see it in the logs? Let's use info?
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang <[email protected]>
Signed-off-by: Tianpeng Wang [email protected]
Commit Message: admin: Change multiple log levels at once
Additional Description:
Risk Level: Low
Testing: unit tests, integration tests
Docs Changes: Required
Release Notes: Required
Platform Specific Features: N/A