Skip to content

feat: stable logger#13907

Merged
ematipico merged 9 commits into
v7from
feat/custom-logger
Jun 9, 2026
Merged

feat: stable logger#13907
ematipico merged 9 commits into
v7from
feat/custom-logger

Conversation

@ematipico

@ematipico ematipico commented May 18, 2026

Copy link
Copy Markdown
Member

Description (required)

This PR adds documentation for the logger APIs, which will be stable soon

For Astro version: 7.0.0. See astro PR #16745.

@ematipico ematipico added merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" = approved for merging on release day. labels May 18, 2026
@netlify

netlify Bot commented May 18, 2026

Copy link
Copy Markdown

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 9f23de1
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6a281c6f50565a00081e974a
😎 Deploy Preview https://deploy-preview-13907--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston

astrobot-houston commented May 18, 2026

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/reference/api-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/logger-reference.mdx Localization added, will be marked as complete.
fr/reference/experimental-flags/logger.mdx Localization removed, will be marked as missing.
ko/reference/experimental-flags/logger.mdx Localization removed, will be marked as missing.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Already! Ahah, you move too fast for the French reviewers... I guess I can close #13830 😅

Speaking of that, the link error is because of the Korean translation. We usually delete the translations as well when we stabilize an experimental feature.

I know the content hasn't changed much... maybe we should consider renaming the translation and using a Lunaria directive in a case like this. But, I believe Junseong is able to easily browse the Git history to recover its translation so we can remove it for now.

I left a few suggestions to be consistent with our other references (a bit more verbose in some places, functions notation).

Is Astro.logger particularly useful with custom loggers? If so, maybe we should add a link to /en/reference/api-reference/#logger to improve its discoverability. If not, no change needed!

Also, I noticed we now have loggerConfig in SSRManifest. We'll need a new section in https://docs.astro.build/en/reference/integrations-reference/#ssrmanifest

Comment thread src/content/docs/en/reference/api-reference.mdx
Comment thread src/content/docs/en/reference/api-reference.mdx Outdated
Comment thread src/content/docs/en/reference/api-reference.mdx Outdated
Comment thread src/content/docs/en/reference/api-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
@ArmandPhilippot ArmandPhilippot added this to the 6.4 milestone May 18, 2026
ematipico and others added 2 commits May 19, 2026 15:21
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label May 19, 2026
@ematipico

ematipico commented May 19, 2026

Copy link
Copy Markdown
Member Author

Is Astro.logger particularly useful with custom loggers? If so, maybe we should add a link to /en/reference/api-reference/#logger to improve its discoverability. If not, no change needed!

It's the whole point! Ahahaha. Dufus me that I completely overlooked this important connection. The important thing is that the runtime APIs are always at user's disposal regardless of a custom logger, but with a custom logger users have more control.

My last commit added a small paragraph with the link

Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
ematipico and others added 2 commits May 19, 2026 16:35
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was double checking, and I think this is almost ready.

  • In the SSRManifest reference, we need a section for loggerConfig. And, now we have a section for log levels, we should update the SSRManifest.logLevel description with a link to that section.
  • I left a question about log levels because debug and silent are also available but we do not explain how they differ.

Edit: I found another place https://docs.astro.build/en/reference/modules/astro-config/#imports-from-astroconfig we'll need to add logHandlers there. A good occasion to create a link to the Logger API there!

});
```

### `logHandlers.compose`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I missed this one, parentheses for consistency:

Suggested change
### `logHandlers.compose()`

Comment thread src/content/docs/en/reference/logger-reference.mdx
Comment thread src/content/docs/en/reference/logger-reference.mdx Outdated
@ematipico ematipico added the 7.0 label May 26, 2026
@ematipico ematipico removed this from the 6.4 milestone May 26, 2026
@ematipico ematipico removed the minor-release For the next minor release; in the milestone, "merge queue" = approved for merging on release day. label May 26, 2026
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@ArmandPhilippot

Copy link
Copy Markdown
Member

Ah, right, my French PR finally got merged. We'll need to remove it to fix the failing check!

@ematipico ematipico changed the base branch from main to v7 June 8, 2026 13:36
@ArmandPhilippot ArmandPhilippot added this to the v7 milestone Jun 8, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🚫 Deployment cancelled
View logs
docs 9f23de1 Jun 09 2026, 02:19 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
9f23de1 2026-06-09T14:03:18.050Z View logs ↗

@ematipico ematipico requested a review from ArmandPhilippot June 9, 2026 14:55
@ematipico ematipico merged commit d0fb1a6 into v7 Jun 9, 2026
12 of 13 checks passed
@ematipico ematipico deleted the feat/custom-logger branch June 9, 2026 15:03
@ematipico ematipico mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.0 i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants