fix(node): resolve experimental logger before logging server startup …#16985
Merged
ematipico merged 7 commits intoJun 8, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 72704a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 399 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ematipico
approved these changes
Jun 8, 2026
Comment on lines
+35
to
+39
| // Resolve the user-configured logger before logging the startup message. | ||
| // getLogger() resolves before the OS finishes binding the port (and emitting | ||
| // 'listening'), so logListeningOn's once('listening') handler is registered | ||
| // in time. standalone() stays synchronous so callers receive the server object | ||
| // immediately, as they did before. |
Member
There was a problem hiding this comment.
Suggested change
| // Resolve the user-configured logger before logging the startup message. | |
| // getLogger() resolves before the OS finishes binding the port (and emitting | |
| // 'listening'), so logListeningOn's once('listening') handler is registered | |
| // in time. standalone() stays synchronous so callers receive the server object | |
| // immediately, as they did before. |
dadezzz
pushed a commit
to dadezzz/university_notes
that referenced
this pull request
Jun 13, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`6.4.4` → `6.4.5`](https://renovatebot.com/diffs/npm/astro/6.4.4/6.4.5) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v6.4.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#645) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.4...astro@6.4.5) ##### Patch Changes - [#​16985](withastro/astro#16985) [`4ecff32`](withastro/astro@4ecff32) Thanks [@​maximslo](https://github.com/maximslo)! - Fixes the `experimental.logger` destination not being used for the "Server listening on..." startup message. The logger is now resolved before the server starts listening, and `adapterLogger` re-creates itself when the underlying logger changes so the startup message uses the correct destination. - [#​16947](withastro/astro#16947) [`e0703a6`](withastro/astro@e0703a6) Thanks [@​ematipico](https://github.com/ematipico)! - Fixes `Astro.request.url` not reflecting validated `X-Forwarded-Proto`/`X-Forwarded-Host` headers when `security.allowedDomains` is configured. Previously, only `Astro.url` was updated with the forwarded origin while `Astro.request.url` retained the socket-derived URL, causing the two to diverge behind TLS-terminating proxies. - [#​16997](withastro/astro#16997) [`dc45246`](withastro/astro@dc45246) Thanks [@​matthewp](https://github.com/matthewp)! - Reverts a change to `isNode` runtime detection that caused a significant build time regression for Cloudflare adapter users with large prerendered sites </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTQuNSIsInVwZGF0ZWRJblZlciI6IjQzLjIxNC41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16974 so startup message shows on
experimental.loggerdestination, not default terminal.Currently it fires before any request arrives, always missing the user-configured destination.
Changes
getLogger().then()before logListeningOn to correct destination.adapterLoggerre-create itself when the underlying logger instance changes, so it always reflects the resolved logger regardless of first accessTesting
Before Implementation
After Implementation
Confirmed the first line of stdout is
{"message":"Server listening on ...","label":"@astrojs/node","level":"info"}when manually building standalone server.Added unit test verifying that
adapterLoggerre-creates itself whenpipeline.getLogger()replaces the underlying logger instance. Both packages build without errors.Docs
No update needed.