From b5271b7948194888ed26c1aec0cae45dc646fa4e Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Mon, 19 Aug 2024 13:58:00 -0700 Subject: [PATCH 01/10] basic structured logging Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 17 +++++++++-- python/ray/data/_internal/logging_json.yaml | 34 +++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 python/ray/data/_internal/logging_json.yaml diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index 0a9a5a8f7093..06e3824b4eeb 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -2,15 +2,21 @@ import logging.config import os from typing import Optional - import yaml import ray -DEFAULT_CONFIG_PATH = os.path.abspath( +DEFAULT_TEXT_CONFIG_PATH = os.path.abspath( os.path.join(os.path.dirname(__file__), "logging.yaml") ) +DEFAULT_JSON_CONFIG_PATH = os.path.abspath( + os.path.join(os.path.dirname(__file__), "logging_json.yaml") +) + +# Environment variable name for to specify the encoding of the log messages +RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "TEXT") + # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data # logs every scheduler loop, logging might impact performance. So, we add a "TRACE" # level where logs aren't written by default. @@ -93,7 +99,12 @@ def configure_logging() -> None: environment variable. If the variable isn't set, this function loads the "logging.yaml" file that is adjacent to this module. """ - config_path = os.environ.get("RAY_DATA_LOGGING_CONFIG", DEFAULT_CONFIG_PATH) + if "RAY_DATA_LOGGING_CONFIG" in os.environ: + config_path = os.environ.get("RAY_DATA_LOGGING_CONFIG") + elif RAY_DATA_LOG_ENCODING == "JSON": + config_path = DEFAULT_JSON_CONFIG_PATH + else: + config_path = DEFAULT_TEXT_CONFIG_PATH with open(config_path) as file: config = yaml.safe_load(file) logging.config.dictConfig(config) diff --git a/python/ray/data/_internal/logging_json.yaml b/python/ray/data/_internal/logging_json.yaml new file mode 100644 index 000000000000..0fa49a590d53 --- /dev/null +++ b/python/ray/data/_internal/logging_json.yaml @@ -0,0 +1,34 @@ +version: 1 +disable_existing_loggers: False + +formatters: + ray: + class: ray._private.ray_logging.formatters.JSONFormatter + +filters: + console_filter: + (): ray.data._internal.logging.HiddenRecordFilter + core_context_filter: + class: ray._private.ray_logging.filters.CoreContextFilter + +handlers: + file: + class: ray.data._internal.logging.SessionFileHandler + formatter: ray + filename: ray-data.log + filters: [core_context_filter] + console: + class: ray._private.log.PlainRayHandler + formatter: ray + level: INFO + filters: [console_filter, core_context_filter] + +loggers: + ray.data: + level: DEBUG + handlers: [file, console] + propagate: False + ray.air.util.tensor_extensions: + level: DEBUG + handlers: [file, console] + propagate: False From dd44baae705d3ba29a699592a506d685dbef8540 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Tue, 20 Aug 2024 12:58:37 -0700 Subject: [PATCH 02/10] respond to feedback Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index 06e3824b4eeb..a542718ca07a 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -2,6 +2,7 @@ import logging.config import os from typing import Optional + import yaml import ray @@ -14,9 +15,12 @@ os.path.join(os.path.dirname(__file__), "logging_json.yaml") ) -# Environment variable name for to specify the encoding of the log messages +# Environment variable to specify the encoding of the log messages RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "TEXT") +# Environment variable to specify the logging config path use defaults if not set +RAY_DATA_LOGGING_CONFIG_PATH = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") + # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data # logs every scheduler loop, logging might impact performance. So, we add a "TRACE" # level where logs aren't written by default. @@ -99,14 +103,16 @@ def configure_logging() -> None: environment variable. If the variable isn't set, this function loads the "logging.yaml" file that is adjacent to this module. """ - if "RAY_DATA_LOGGING_CONFIG" in os.environ: - config_path = os.environ.get("RAY_DATA_LOGGING_CONFIG") + if RAY_DATA_LOGGING_CONFIG_PATH is not None: + config_path = RAY_DATA_LOGGING_CONFIG_PATH elif RAY_DATA_LOG_ENCODING == "JSON": config_path = DEFAULT_JSON_CONFIG_PATH else: config_path = DEFAULT_TEXT_CONFIG_PATH + with open(config_path) as file: config = yaml.safe_load(file) + logging.config.dictConfig(config) From 517eda8895252f026c12375c087dfe7c0a96cddb Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Tue, 20 Aug 2024 13:03:00 -0700 Subject: [PATCH 03/10] Update python/ray/data/_internal/logging.py Co-authored-by: Scott Lee Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index a542718ca07a..8b035c49fffa 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -16,7 +16,7 @@ ) # Environment variable to specify the encoding of the log messages -RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "TEXT") +RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING") # Environment variable to specify the logging config path use defaults if not set RAY_DATA_LOGGING_CONFIG_PATH = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") From 9450689422d4a8192751a32203ace29236821653 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Mon, 9 Sep 2024 15:38:15 -0700 Subject: [PATCH 04/10] Update python/ray/data/_internal/logging.py Co-authored-by: Hao Chen Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index 8b035c49fffa..cff132c2a1ca 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -16,7 +16,7 @@ ) # Environment variable to specify the encoding of the log messages -RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING") +RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "").upper() # Environment variable to specify the logging config path use defaults if not set RAY_DATA_LOGGING_CONFIG_PATH = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") From 8511d378e74cf70190c3d731558b7aa81e63aa93 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Tue, 10 Sep 2024 14:03:51 -0700 Subject: [PATCH 05/10] JSON mode log text to console Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging_json.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ray/data/_internal/logging_json.yaml b/python/ray/data/_internal/logging_json.yaml index 0fa49a590d53..78d9c7a23f3d 100644 --- a/python/ray/data/_internal/logging_json.yaml +++ b/python/ray/data/_internal/logging_json.yaml @@ -4,6 +4,8 @@ disable_existing_loggers: False formatters: ray: class: ray._private.ray_logging.formatters.JSONFormatter + ray_console: + format: "%(asctime)s\t%(levelname)s %(filename)s:%(lineno)s -- %(message)s" filters: console_filter: @@ -19,7 +21,7 @@ handlers: filters: [core_context_filter] console: class: ray._private.log.PlainRayHandler - formatter: ray + formatter: ray_console level: INFO filters: [console_filter, core_context_filter] From 9608e3b64688ca75f8277276f5cf4ef72bcd92bb Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Thu, 19 Sep 2024 16:38:01 -0700 Subject: [PATCH 06/10] update code to use single config, tweak logic to accommodate this Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 45 +++++++++++++-------- python/ray/data/_internal/logging.yaml | 9 +++++ python/ray/data/_internal/logging_json.yaml | 36 ----------------- 3 files changed, 38 insertions(+), 52 deletions(-) delete mode 100644 python/ray/data/_internal/logging_json.yaml diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index cff132c2a1ca..e68364666265 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -7,18 +7,14 @@ import ray -DEFAULT_TEXT_CONFIG_PATH = os.path.abspath( +DEFAULT_CONFIG_PATH = os.path.abspath( os.path.join(os.path.dirname(__file__), "logging.yaml") ) -DEFAULT_JSON_CONFIG_PATH = os.path.abspath( - os.path.join(os.path.dirname(__file__), "logging_json.yaml") -) - -# Environment variable to specify the encoding of the log messages +# Env. variable to specify the encoding of the file logs when using the default config. RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "").upper() -# Environment variable to specify the logging config path use defaults if not set +# Env. variable to specify the logging config path use defaults if not set RAY_DATA_LOGGING_CONFIG_PATH = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data @@ -99,22 +95,39 @@ def _try_create_handler(self): def configure_logging() -> None: """Configure the Python logger named 'ray.data'. - This function loads the configration YAML specified by the "RAY_DATA_LOGGING_CONFIG" - environment variable. If the variable isn't set, this function loads the + This function loads the configration YAML specified by "RAY_DATA_LOGGING_CONFIG" + environment variable. If the variable isn't set, this function loads the default "logging.yaml" file that is adjacent to this module. + + If "RAY_DATA_LOG_ENCODING" is specified as "JSON" we will enable JSON reading mode + if using the default logging config. """ + + def _load_logging_config(config_path: str): + with open(config_path) as file: + config = yaml.safe_load(file) + return config + if RAY_DATA_LOGGING_CONFIG_PATH is not None: - config_path = RAY_DATA_LOGGING_CONFIG_PATH - elif RAY_DATA_LOG_ENCODING == "JSON": - config_path = DEFAULT_JSON_CONFIG_PATH + config = _load_logging_config(RAY_DATA_LOGGING_CONFIG_PATH) else: - config_path = DEFAULT_TEXT_CONFIG_PATH - - with open(config_path) as file: - config = yaml.safe_load(file) + config = _load_logging_config(DEFAULT_CONFIG_PATH) + if RAY_DATA_LOG_ENCODING == "JSON": + for logger in config["loggers"].values(): + logger["handlers"].remove("file") + logger["handlers"].append("file_json") logging.config.dictConfig(config) + # After configuring logger, warn if RAY_DATA_LOGGING_CONFIG_PATH is used with + # RAY_DATA_LOG_ENCODING, because they are not both supported together. + if RAY_DATA_LOGGING_CONFIG_PATH is not None and RAY_DATA_LOG_ENCODING is not None: + logger = logging.getLogger("ray.data") + logger.warning( + "Using `RAY_DATA_LOG_ENCODING` is not supported with " + + "`RAY_DATA_LOGGING_CONFIG_PATH`" + ) + def reset_logging() -> None: """Reset the logger named 'ray.data' to its initial state. diff --git a/python/ray/data/_internal/logging.yaml b/python/ray/data/_internal/logging.yaml index f72abf356f6d..5e48b1194cb8 100644 --- a/python/ray/data/_internal/logging.yaml +++ b/python/ray/data/_internal/logging.yaml @@ -4,16 +4,25 @@ disable_existing_loggers: False formatters: ray: format: "%(asctime)s\t%(levelname)s %(filename)s:%(lineno)s -- %(message)s" + ray_json: + class: ray._private.ray_logging.formatters.JSONFormatter filters: console_filter: (): ray.data._internal.logging.HiddenRecordFilter + core_context_filter: + class: ray._private.ray_logging.filters.CoreContextFilter handlers: file: class: ray.data._internal.logging.SessionFileHandler formatter: ray filename: ray-data.log + file_json: + class: ray.data._internal.logging.SessionFileHandler + formatter: ray_json + filename: ray-data.log + filters: [core_context_filter] console: class: ray._private.log.PlainRayHandler formatter: ray diff --git a/python/ray/data/_internal/logging_json.yaml b/python/ray/data/_internal/logging_json.yaml deleted file mode 100644 index 78d9c7a23f3d..000000000000 --- a/python/ray/data/_internal/logging_json.yaml +++ /dev/null @@ -1,36 +0,0 @@ -version: 1 -disable_existing_loggers: False - -formatters: - ray: - class: ray._private.ray_logging.formatters.JSONFormatter - ray_console: - format: "%(asctime)s\t%(levelname)s %(filename)s:%(lineno)s -- %(message)s" - -filters: - console_filter: - (): ray.data._internal.logging.HiddenRecordFilter - core_context_filter: - class: ray._private.ray_logging.filters.CoreContextFilter - -handlers: - file: - class: ray.data._internal.logging.SessionFileHandler - formatter: ray - filename: ray-data.log - filters: [core_context_filter] - console: - class: ray._private.log.PlainRayHandler - formatter: ray_console - level: INFO - filters: [console_filter, core_context_filter] - -loggers: - ray.data: - level: DEBUG - handlers: [file, console] - propagate: False - ray.air.util.tensor_extensions: - level: DEBUG - handlers: [file, console] - propagate: False From e986017bb8a1dbbdcc396c6ec945d56fa187dd87 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Mon, 23 Sep 2024 13:35:09 -0700 Subject: [PATCH 07/10] adding in test and dynamic env var loading Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 16 ++++++---- python/ray/data/tests/test_logging.py | 43 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index e68364666265..d0d03a4b1a9a 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -12,10 +12,10 @@ ) # Env. variable to specify the encoding of the file logs when using the default config. -RAY_DATA_LOG_ENCODING = os.environ.get("RAY_DATA_LOG_ENCODING", "").upper() +RAY_DATA_LOG_ENCODING = "RAY_DATA_LOG_ENCODING" # Env. variable to specify the logging config path use defaults if not set -RAY_DATA_LOGGING_CONFIG_PATH = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") +RAY_DATA_LOGGING_CONFIG_PATH = "RAY_DATA_LOGGING_CONFIG_PATH" # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data # logs every scheduler loop, logging might impact performance. So, we add a "TRACE" @@ -108,11 +108,15 @@ def _load_logging_config(config_path: str): config = yaml.safe_load(file) return config - if RAY_DATA_LOGGING_CONFIG_PATH is not None: - config = _load_logging_config(RAY_DATA_LOGGING_CONFIG_PATH) + # Dynamically load env vars + config_path = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") + log_encoding = os.environ.get("RAY_DATA_LOG_ENCODING") + + if config_path is not None: + config = _load_logging_config(config_path) else: config = _load_logging_config(DEFAULT_CONFIG_PATH) - if RAY_DATA_LOG_ENCODING == "JSON": + if log_encoding is not None and log_encoding.upper() == "JSON": for logger in config["loggers"].values(): logger["handlers"].remove("file") logger["handlers"].append("file_json") @@ -121,7 +125,7 @@ def _load_logging_config(config_path: str): # After configuring logger, warn if RAY_DATA_LOGGING_CONFIG_PATH is used with # RAY_DATA_LOG_ENCODING, because they are not both supported together. - if RAY_DATA_LOGGING_CONFIG_PATH is not None and RAY_DATA_LOG_ENCODING is not None: + if config_path is not None and log_encoding is not None: logger = logging.getLogger("ray.data") logger.warning( "Using `RAY_DATA_LOG_ENCODING` is not supported with " diff --git a/python/ray/data/tests/test_logging.py b/python/ray/data/tests/test_logging.py index de18e4452384..ace59dbcda92 100644 --- a/python/ray/data/tests/test_logging.py +++ b/python/ray/data/tests/test_logging.py @@ -124,6 +124,49 @@ def test_custom_config(reset_logging, monkeypatch, tmp_path): assert isinstance(logger.handlers[0], logging.StreamHandler) +def test_json_logging_configuration( + capsys, reset_logging, monkeypatch, shutdown_only, propagate_logs +): + monkeypatch.setenv("RAY_DATA_LOG_ENCODING", "JSON") + ray.init() + + configure_logging() + + logger = logging.getLogger("ray.data") + + # Ensure handlers correctly setup + handlers = logger.handlers + assert len(handlers) == 2 + assert sum(handler.name == "file_json" for handler in handlers) == 1 + assert sum(handler.name == "console" for handler in handlers) == 1 + + logger.info("ham") + logger.debug("turkey") + + log_path = os.path.join(get_log_directory(), "ray-data.log") + with open(log_path) as file: + log_contents = file.read() + + # Validate the log is in JSON format (a basic check for JSON) + assert all( + log_line.startswith("{") and log_line.endswith("}") + for log_line in log_contents.splitlines() + ) + + assert '"message": "ham"' in log_contents + assert '"message": "turkey"' in log_contents + + # Validate console logs are in text mode + console_log_output = capsys.readouterr().err + assert not any( + log_line.startswith("{") and log_line.endswith("}") + for log_line in console_log_output.splitlines() + ) + + assert "ham" in console_log_output + assert "turkey" not in console_log_output + + if __name__ == "__main__": import sys From 1216470fd069a9226b384540aad208116ee9ff35 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Wed, 9 Oct 2024 11:19:06 -0700 Subject: [PATCH 08/10] swap class for () to make corecontextfilter work Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ray/data/_internal/logging.yaml b/python/ray/data/_internal/logging.yaml index 5e48b1194cb8..170d7c6605d8 100644 --- a/python/ray/data/_internal/logging.yaml +++ b/python/ray/data/_internal/logging.yaml @@ -11,7 +11,7 @@ filters: console_filter: (): ray.data._internal.logging.HiddenRecordFilter core_context_filter: - class: ray._private.ray_logging.filters.CoreContextFilter + (): ray._private.ray_logging.filters.CoreContextFilter handlers: file: From a2e43776a8cdda8ebed9edb1f3d99fd11d331a78 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Thu, 10 Oct 2024 11:02:16 -0700 Subject: [PATCH 09/10] pr feedback Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index d0d03a4b1a9a..780770eabcf7 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -12,10 +12,10 @@ ) # Env. variable to specify the encoding of the file logs when using the default config. -RAY_DATA_LOG_ENCODING = "RAY_DATA_LOG_ENCODING" +RAY_DATA_LOG_ENCODING_ENV_VAR_NAME = "RAY_DATA_LOG_ENCODING" # Env. variable to specify the logging config path use defaults if not set -RAY_DATA_LOGGING_CONFIG_PATH = "RAY_DATA_LOGGING_CONFIG_PATH" +RAY_DATA_LOGGING_CONFIG_PATH_ENV_VAR_NAME = "RAY_DATA_LOGGING_CONFIG_PATH" # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data # logs every scheduler loop, logging might impact performance. So, we add a "TRACE" @@ -99,7 +99,7 @@ def configure_logging() -> None: environment variable. If the variable isn't set, this function loads the default "logging.yaml" file that is adjacent to this module. - If "RAY_DATA_LOG_ENCODING" is specified as "JSON" we will enable JSON reading mode + If "RAY_DATA_LOG_ENCODING" is specified as "JSON" we will enable JSON logging mode if using the default logging config. """ @@ -109,8 +109,8 @@ def _load_logging_config(config_path: str): return config # Dynamically load env vars - config_path = os.environ.get("RAY_DATA_LOGGING_CONFIG_PATH") - log_encoding = os.environ.get("RAY_DATA_LOG_ENCODING") + config_path = os.environ.get(RAY_DATA_LOGGING_CONFIG_PATH_ENV_VAR_NAME) + log_encoding = os.environ.get(RAY_DATA_LOG_ENCODING_ENV_VAR_NAME) if config_path is not None: config = _load_logging_config(config_path) @@ -126,7 +126,7 @@ def _load_logging_config(config_path: str): # After configuring logger, warn if RAY_DATA_LOGGING_CONFIG_PATH is used with # RAY_DATA_LOG_ENCODING, because they are not both supported together. if config_path is not None and log_encoding is not None: - logger = logging.getLogger("ray.data") + logger = logging.getLogger(__name__) logger.warning( "Using `RAY_DATA_LOG_ENCODING` is not supported with " + "`RAY_DATA_LOGGING_CONFIG_PATH`" From b4e0e6a8cc6ed9797f1ed83fcb232e3a9a58ae74 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Thu, 10 Oct 2024 11:41:37 -0700 Subject: [PATCH 10/10] update env var name Signed-off-by: Matthew Owen --- python/ray/data/_internal/logging.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ray/data/_internal/logging.py b/python/ray/data/_internal/logging.py index 780770eabcf7..ae0991e4adbe 100644 --- a/python/ray/data/_internal/logging.py +++ b/python/ray/data/_internal/logging.py @@ -15,7 +15,7 @@ RAY_DATA_LOG_ENCODING_ENV_VAR_NAME = "RAY_DATA_LOG_ENCODING" # Env. variable to specify the logging config path use defaults if not set -RAY_DATA_LOGGING_CONFIG_PATH_ENV_VAR_NAME = "RAY_DATA_LOGGING_CONFIG_PATH" +RAY_DATA_LOGGING_CONFIG_ENV_VAR_NAME = "RAY_DATA_LOGGING_CONFIG" # To facilitate debugging, Ray Data writes debug logs to a file. However, if Ray Data # logs every scheduler loop, logging might impact performance. So, we add a "TRACE" @@ -109,7 +109,7 @@ def _load_logging_config(config_path: str): return config # Dynamically load env vars - config_path = os.environ.get(RAY_DATA_LOGGING_CONFIG_PATH_ENV_VAR_NAME) + config_path = os.environ.get(RAY_DATA_LOGGING_CONFIG_ENV_VAR_NAME) log_encoding = os.environ.get(RAY_DATA_LOG_ENCODING_ENV_VAR_NAME) if config_path is not None: @@ -123,13 +123,13 @@ def _load_logging_config(config_path: str): logging.config.dictConfig(config) - # After configuring logger, warn if RAY_DATA_LOGGING_CONFIG_PATH is used with + # After configuring logger, warn if RAY_DATA_LOGGING_CONFIG is used with # RAY_DATA_LOG_ENCODING, because they are not both supported together. if config_path is not None and log_encoding is not None: logger = logging.getLogger(__name__) logger.warning( "Using `RAY_DATA_LOG_ENCODING` is not supported with " - + "`RAY_DATA_LOGGING_CONFIG_PATH`" + + "`RAY_DATA_LOGGING_CONFIG`" )