# How to enable RAYLOG (DEBUG) when using bazel test locally？

**URL:** <https://discuss.ray.io/t/how-to-enable-raylog-debug-when-using-bazel-test-locally/22543>\
**Category:** Ray Core\
**Created:** [May 21, 2025, 10:01am UTC](https://discuss.ray.io/t/how-to-enable-raylog-debug-when-using-bazel-test-locally/22543 "2025-05-21T10:01:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinlu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jinlu/32/7988_2.png) [@jinlu](https://discuss.ray.io/u/jinlu)\
**Post date:** [May 21, 2025, 10:01am UTC](https://discuss.ray.io/t/how-to-enable-raylog-debug-when-using-bazel-test-locally/22543/1 "2025-05-21T10:01:28Z")

</div>

I am currently using the command `bazel test --cxxopt=-std=c++17 --test_output=all --experimental_ui_max_stdouterr_bytes=10485760 --cache_test_results=no //:xxx`, and then tried to print the RAYLOG(DEBUG) related output that comes with RAY, but I couldn’t see it

I have read the official documentation, but after I set `RAY_BACKEND_LOG_LEVEL` to “DEBUG” in bazel’s env, I still couldn’t print the DEBUG level log

I used three methods:

1. Add `--test_env=RAY_BACKEND_LOG_LEVEL="DEBUG"` in **bazel test**

2. Add `test --test_env=RAY_BACKEND_LOG_LEVEL="DEBUG"` in **.bazelrc**

3. Add `env = {"RAY_BACKEND_LOG_LEVEL": "DEBUG",},` in **BUILD.bazel**

I really want to know how to correctly print the DEBUG log.

---

<div class="post-metadata">

**Author:** ![jinlu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jinlu/32/7988_2.png) [@jinlu](https://discuss.ray.io/u/jinlu)\
**Post date:** [May 21, 2025, 11:16am UTC](https://discuss.ray.io/t/how-to-enable-raylog-debug-when-using-bazel-test-locally/22543/2 "2025-05-21T11:16:11Z")

</div>

I have solved this problem: call the StartRayLog method of RayLog in the single test method and set the corresponding log level
