Skip to content
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

Fix log timezone in task log view (#19342) #19401

Merged
merged 1 commit into from
Nov 5, 2021

Conversation

calfzhou
Copy link
Contributor

@calfzhou calfzhou commented Nov 4, 2021

Fix #19342 such that when using non-UTC timezone (change default_timezone and airflow server's timezone), task's log in web interface will give incorrect log times.

Since python logging module saves asctime without timezone, the solution is simply add server's timezone offset (e.g. "Europe/Moscow" => "+03:00") to every asctime in the log file.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Nov 4, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 4, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calfzou Looking good, but please add a description to the PR.

@calfzhou
Copy link
Contributor Author

calfzhou commented Nov 5, 2021

@calfzou Looking good, but please add a description to the PR.

@bbovenzi description added 😄

@bbovenzi
Copy link
Contributor

bbovenzi commented Nov 5, 2021

We aren't importing moment or Airflow directly. You need to add them to the global declaration near the top of the file like so: /* global document, window, $, moment, Airflow */

@calfzhou
Copy link
Contributor Author

calfzhou commented Nov 5, 2021

We aren't importing moment or Airflow directly. You need to add them to the global declaration near the top of the file like so: /* global document, window, $, moment, Airflow */

fixed ~~

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@bbovenzi bbovenzi merged commit c96789b into apache:main Nov 5, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 5, 2021

Awesome work, congrats on your first merged pull request!

@jedcunningham jedcunningham added this to the Airflow 2.2.3 milestone Dec 7, 2021
jedcunningham pushed a commit that referenced this pull request Dec 7, 2021
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Dec 8, 2021
@freshlu11
Copy link

@calfzhou
Copy link
Contributor Author

This bug occurs in 2.3.0 again https://github.com/apache/airflow/blob/2.3.0/airflow/www/static/js/ti_log.js

might caused by recent change: #23075

@potiuk
Copy link
Member

potiuk commented May 19, 2022

Can you please open a new issue for that ? Thanks in advance

@freshlu11
Copy link

ok, wait a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webserver shows wrong datetime (timezone) in log
5 participants