Skip to content

logging: update MozLogFormatter to output MozLog (bug 1977738)#834

Closed
shtrom wants to merge 8 commits intomainfrom
bug1977738/MozLogFormatter
Closed

logging: update MozLogFormatter to output MozLog (bug 1977738)#834
shtrom wants to merge 8 commits intomainfrom
bug1977738/MozLogFormatter

Conversation

@shtrom
Copy link
Member

@shtrom shtrom commented Jan 13, 2026

There are two MozLog standards

  1. https://wiki.mozilla.org/Firefox/Services/Logging#MozLog_application_logging_standard
  2. https://firefox-source-docs.mozilla.org/mozbase/mozlog.html#data-format

Up to now, lando was outputing the former, but this wasn't formatted very nicely in the GCP Log Explorer.

Instead, modifying the MozLogFormatter to output data in a format compatible with the latter works much better.

For the time being, the originally-formatted data is retained, as it doesn't impact the formatting in the Logs Explorer.


  • logging: update MozLogFormatter to output MozLog (bug 1977738)
  • landing_worker: fix log message typo
  • worker: log Worker.name when paused
  • dockerflow: log heartbeat requests at debug level

@github-actions
Copy link

View this pull request in Lando to land it once approved.

@shtrom shtrom force-pushed the bug1977738/MozLogFormatter branch 2 times, most recently from 4d6b12c to 828545d Compare January 13, 2026 03:59
@shtrom shtrom force-pushed the bug1977738/MozLogFormatter branch 2 times, most recently from 8f904d8 to 8533245 Compare January 13, 2026 05:37
@shtrom shtrom changed the title remote_settings: use MozLogFormatter (bug 1977738) logging: update MozLogFormatter to output MozLog (bug 1977738) Jan 13, 2026
@shtrom shtrom force-pushed the bug1977738/MozLogFormatter branch from 8533245 to e4a1720 Compare January 13, 2026 05:47
@shtrom shtrom force-pushed the bug1977738/MozLogFormatter branch from e4a1720 to 156756f Compare January 13, 2026 05:52
@shtrom shtrom marked this pull request as ready for review January 13, 2026 06:12
@shtrom shtrom requested a review from a team as a code owner January 13, 2026 06:12
zzzeid
zzzeid previously requested changes Jan 13, 2026
STATIC_URL = os.getenv("STATIC_URL")

# Defined in lando.settings.
STATIC_URL = os.getenv("STATIC_URL", STATIC_URL) # noqa: F405
Copy link
Contributor

Choose a reason for hiding this comment

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

Not clear why we are doing this here. All remote environments should set their own value here, vs. using what's in lando.settings. Can you add a comment explaining the reasoning behind this?

Copy link
Member Author

@shtrom shtrom Jan 13, 2026

Choose a reason for hiding this comment

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

I added this comment to the code:

If missing, we default to STATIC_URL, from the from settings import *.
This allows the code to run in a local environment configured to simulate a remote
environment.

Alternatively, we could add a commented-out definition of STATIC_URL in the compose.yaml file alongside ENVIRONMENT and DJANGO_SETTINGS_MODULE, but I thought it was better to make the issue self-correcting.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this could be better handled, given that we may handle this stuff with a make command or other type of script. I.e., we could set this value explicitly in the environment when in "simulate remote environment" mode without needing to have a special case for this value here.

zzzeid
zzzeid previously requested changes Jan 14, 2026
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

See my comment on mozilla-conduit/suite#77 RE: maybe adding this to a make command instead. I think there is value in documenting this, or making it more easily switchable, but I think we might as well add a make command for this. I assume updating the .env or even an environment variable directly for may be sufficient?

@shtrom
Copy link
Member Author

shtrom commented Jan 15, 2026

See my comment on mozilla-conduit/suite#77 RE: maybe adding this to a make command instead. I think there is value in documenting this, or making it more easily switchable, but I think we might as well add a make command for this. I assume updating the .env or even an environment variable directly for may be sufficient?

Ok, I think this change is better suited for suite (no pun intended) anyway. I removed the compose.yaml changes from here, and then we can iterate on mozilla-conduit/suite#77

@shtrom shtrom requested a review from zzzeid January 15, 2026 05:24
@shtrom shtrom dismissed zzzeid’s stale review January 15, 2026 05:24

reverted changes to compose.yaml

Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

lgtm, with one nit.

STATIC_URL = os.getenv("STATIC_URL")

# Defined in lando.settings.
STATIC_URL = os.getenv("STATIC_URL", STATIC_URL) # noqa: F405
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this could be better handled, given that we may handle this stuff with a make command or other type of script. I.e., we could set this value explicitly in the environment when in "simulate remote environment" mode without needing to have a special case for this value here.

@lando-prod-mozilla
Copy link

Pull request closed by commit 12f2665

lando-prod-mozilla bot pushed a commit that referenced this pull request Jan 18, 2026
…han,zeid

There are two MozLog standards

1. https://wiki.mozilla.org/Firefox/Services/Logging#MozLog_application_logging_standard
2. https://firefox-source-docs.mozilla.org/mozbase/mozlog.html#data-format

Up to now, lando was outputing the former, but this wasn't formatted very nicely in the GCP Log Explorer.

Instead, modifying the `MozLogFormatter` to output data in a format compatible with the latter works much better.

For the time being, the originally-formatted data is retained, as it doesn't impact the formatting in the Logs Explorer.

---

 * logging: update MozLogFormatter to output MozLog (bug 1977738)
 * landing_worker: fix log message typo
 * worker: log Worker.name when paused
 * dockerflow: log heartbeat requests at debug level

Pull request: #834
@shtrom shtrom deleted the bug1977738/MozLogFormatter branch January 22, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants