Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 861 Bytes

24811.significant.rst

File metadata and controls

22 lines (15 loc) · 861 Bytes

Added new config [logging]log_formatter_class to fix timezone display for logs on UI

If you are using a custom Formatter subclass in your [logging]logging_config_class, please inherit from airflow.utils.log.timezone_aware.TimezoneAware instead of logging.Formatter. For example, in your custom_config.py:

# before
class YourCustomFormatter(logging.Formatter):
    ...


# after
class YourCustomFormatter(TimezoneAware):
    ...


AIRFLOW_FORMATTER = LOGGING_CONFIG["formatters"]["airflow"]
AIRFLOW_FORMATTER["class"] = "somewhere.your.custom_config.YourCustomFormatter"
# or use TimezoneAware class directly. If you don't have custom Formatter.
AIRFLOW_FORMATTER["class"] = "airflow.utils.log.timezone_aware.TimezoneAware"