rino0601 commented on code in PR #24373:
URL: https://github.com/apache/airflow/pull/24373#discussion_r903430423
##########
newsfragments/24373.improvement.rst:
##########
@@ -0,0 +1 @@
+Support config ``[logging]log_formatter_class`` for overriding
logging.Formatter
Review Comment:
@uranusjr
I misinterpreted significant as breaking change.
Referring to the following paragraph of the contribution guide, it seems
that 'body' to explain the procedure is supported only in the 'significant'
type. is that right?
>In general newsfragments must be one line. For newsfragment type
`significant`, you may include summary and body separated by a blank line,
similar to `git` commit messages.
If so, I think you should change it to a significant type and put the
explanation you suggested. thanks for the comment
----
I don't want to cause a full ci by changing the documentation, so I'd like
to suggest in the comments and get feedback.
I have changed it as follows to reflect your comments. Would it be
appropriate?
> 24373.significant.rst
```
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``:
.. code-block:: python
from airflow.utils.log.timezone_aware import TimezoneAware
class YourOldCustomFormatter(logging.Formatter):
...
class YourCustomFormatter(TimezoneAware):
...
LOGGING_CONFIG["formatters"]["airflow"][
"class"
] = "somewhere.your.custom_config.YourNewCustomFormatter"
# or use TimezoneAware class directly. If you use don't need custom
Formatter.
LOGGING_CONFIG["formatters"]["airflow"][
"class"
] = "airflow.utils.log.timezone_aware.TimezoneAware"
```
line-endings are looks weird but it forced by black during pre-commit
--
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]