-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Highlight log lines by keyword. #47507
base: main
Are you sure you want to change the base?
Conversation
Yeah, we shoudl adjust those light mode colors. First, want to try a light Code background before playign with the text color? We should also make sure this plays well with #47469. Maybe log source shouldn't be by color then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this is -1 for me right now for the reasons below.
@@ -61,6 +61,10 @@ def get_configs() -> ConfigResponse: | |||
"audit_view_included_events": conf.get("webserver", "audit_view_included_events", fallback=""), | |||
"audit_view_excluded_events": conf.get("webserver", "audit_view_excluded_events", fallback=""), | |||
"test_connection": conf.get("core", "test_connection", fallback="Disabled"), | |||
"color_log_error_keywords": conf.get("logging", "color_log_error_keywords", fallback="").split(","), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- there's a
conf.getlist
function - This is a UI setting, not a logging setting
- Now we have structured logging (where the log level comes form the "source" directly without needing to pase , I don't think we should be looking for keywords.
- I really really really REALLY don't want us to add more config options!
Also "Task succeded without error" would get highlighted as an error. Very prone to false positives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a new configuration. This was already present in Airflow 2.10. This is a port of the implementation from the old UI to the new UI. We have use cases where we show logs from external systems like Spark, HDFS etc that are not structured from the triggerer as a log group like "::group::stdout". The keywords help in highlighting the relevant line and improves debugging.
Also "Task succeded without error" would get highlighted as an error. Very prone to false positives.
Agreed, this is like a simple ctrl+f
in the browser and has been more useful than a hindrance,
Config docs : https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#color-log-error-keywords
Airflow 2.10 implementation : #37443
Update API to return
color_log_error_keywords
andcolor_log_warning_keywords
from airflow.cfg through config API. Then in frontend parse the log message to add color attribute to span tag based on the keyword.Notes to self and review :
airflow.cfg values to test as per the screenshot