Hi everyone,
First of all, thank you for creating such an amazing framework as Ray!
I came across the documentation Configure Logging with Ray, which mentions that I can configure the log format using the RAY_LOGGING_CONFIG_ENCODING
environment variable. However, when I try running ray start
with ENV RAY_LOGGING_CONFIG_ENCODING="JSON"
inside a Docker container, I get the following error:
2025-01-23 18:02:47,540 ERROR server.py:134 -- Running Ray Init failed:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/ray/util/client/server/server.py", line 132, in Init
self.ray_connect_handler(job_config, **extra_kwargs)
File "/usr/local/lib/python3.10/site-packages/ray/util/client/server/server.py", line 834, in ray_connect_handler
ray.init(address=address, job_config=job_config, **ray_init_kwargs)
File "/usr/local/lib/python3.10/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/ray/_private/worker.py", line 1450, in init
logging_config = logging_config or LoggingConfig(
File "<string>", line 5, in __init__
File "/usr/local/lib/python3.10/site-packages/ray/_private/ray_logging/logging_config.py", line 88, in __post_init__
raise ValueError(
ValueError: Invalid encoding type: JSON. Valid encoding types are: ['TEXT']
Could you please advise what might be missing in my configuration?
Environment Details:
- Base image:
python:3.10-slim
- Installed packages:
pydantic==2.10.5 ray[serve,data]==2.40.0 # data is for ray.workflow, serve is for ray.serve python-json-logger==3.2.1
Additionally, I noticed that JsonFormatter
is declared in the Ray source code here: ray_logging/formatters.py#L92, but it’s not listed as an option in the encoding type dictionary here: ray_logging/logging_config.py#L27.
Was this intentional, or is JSON logging still experimental/not yet available in Ray 2.40.0?
Thank you for your help!