Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CELEBORN-1797] Support to adjust the logger level with RESTful API during runtime #3022

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

turboFei
Copy link
Member

@turboFei turboFei commented Dec 22, 2024

What changes were proposed in this pull request?

Support to adjust the logger level during runtime without restarting the server.

Why are the changes needed?

It is useful for debug, likes hadoop daemonlog command: https://hadoop.apache.org/docs/r3.4.1/hadoop-project-dist/hadoop-common/CommandsManual.html#daemonlog

Does this PR introduce any user-facing change?

Yes, new RESTful api.

How was this patch tested?

GA.
image

image image

@turboFei turboFei changed the title Log level [CELEBORN-1797] Support to adjust the logger level with RESTful API for debug Dec 22, 2024
@turboFei turboFei changed the title [CELEBORN-1797] Support to adjust the logger level with RESTful API for debug [CELEBORN-1797] Support to adjust the logger level with RESTful API during runtime Dec 22, 2024
@turboFei turboFei requested review from RexXiong and FMX December 23, 2024 08:22
@RexXiong
Copy link
Contributor

LGTM, Thanks @turboFei , change log level at runtime is very useful for debugging.

@@ -456,6 +456,44 @@ paths:
type: string
format: binary

/api/v1/logger:
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR is amazing, can you provide an API to list all logger names since we don't know the logger names?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

Copy link
Member Author

Choose a reason for hiding this comment

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

done
image

Copy link
Member Author

@turboFei turboFei Dec 23, 2024

Choose a reason for hiding this comment

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

Using loggerContext.getConfiguration.getLoggers instead of loggerContext.getLoggers.

image

Copy link
Member Author

@turboFei turboFei Dec 23, 2024

Choose a reason for hiding this comment

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

loggerContext.getConfiguration.getLoggers is reasonable.

It only return the configured logger, including the items in the config file and changed by POST /api/v1/loggers.

<Loggers>
<Root level="INFO">
<AppenderRef ref="stdout"/>
<AppenderRef ref="file"/>
</Root>
<Logger name="org.sparkproject.jetty" level="WARN" additivity="false">
<AppenderRef ref="stdout"/>
<AppenderRef ref="file"/>
</Logger>
</Loggers>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants