Adaverse commented on code in PR #32781:
URL: https://github.com/apache/airflow/pull/32781#discussion_r1271421141


##########
airflow/utils/serve_logs.py:
##########
@@ -44,7 +44,31 @@ def create_app():
     flask_app = Flask(__name__, static_folder=None)
     expiration_time_in_seconds = conf.getint("webserver", 
"log_request_clock_grace", fallback=30)
     log_directory = os.path.expanduser(conf.get("logging", "BASE_LOG_FOLDER"))
-
+    log_config_class = conf.get("logging", "logging_config_class")
+    if log_config_class is not None:
+        logger.info(f"Detected user-defined logging config. Attempting to load 
{log_config_class}")
+        try:
+            import importlib
+
+            module_name, dict_name = log_config_class.split(".")
+            module = importlib.import_module(module_name)
+            logging_config = getattr(module, dict_name)

Review Comment:
   Below can be used instead?
   ```
   from airflow.utils.module_loading import import_string
   logging_config = import_string(log_config_class)
   ``` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to