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

[Serve] use serve logger name for logs in serve #47205

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

GeneDer
Copy link
Contributor

@GeneDer GeneDer commented Aug 19, 2024

Why are these changes needed?

Some Serve logs are not using the configured ray.serve logger, so the logs are redirected to the root logger and can cause unwanted logs to be logged to the terminal when running Serve. This PR ensure all the logger in Serve are using ray.serve logger to log messages.

Tested in premerge using runtime wheel and not seeing the unwanted logs anymore:
image

Also note this is how it looks without the change:
image

Related issue number

Closes: https://github.com/anyscale/ray-llm/issues/1962

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Gene Su <e870252314@gmail.com>
@GeneDer GeneDer added the go add ONLY when ready to merge, run all tests label Aug 19, 2024
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
@GeneDer GeneDer requested a review from edoakes August 19, 2024 22:32
@GeneDer GeneDer marked this pull request as ready for review August 19, 2024 22:32
Copy link
Contributor

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

Do we not need to go through the get_component_logger to set up logging configuration for these?

@GeneDer
Copy link
Contributor Author

GeneDer commented Aug 20, 2024

Do we not need to go through the get_component_logger to set up logging configuration for these?

I think in general cases ray.serve logger is setup together with controller. But I think this is a good point if those modules are imported and used outside of serve, then the ray.serve logger might not already be setup and will still fallback to the root logger. Let me do some more experiment, maybe we just need to setup a default ray.serve logger at import time.

@edoakes edoakes merged commit 3129ada into ray-project:master Aug 20, 2024
5 checks passed
@GeneDer GeneDer mentioned this pull request Aug 20, 2024
8 tasks
edoakes pushed a commit that referenced this pull request Aug 20, 2024
<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->

## Why are these changes needed?

Re:
#47205 (review)
Set up default serve logger to capture logs from serve modules when
using outside of Serve.

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: Gene Su <e870252314@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants