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

filter out POST /api/graphql spam from sndev logs #1780

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

riccardobl
Copy link
Member

@riccardobl riccardobl commented Dec 30, 2024

Description

Since a Next.js update, the dev environment has started logging HTTP requests, which has caused the logs to become cluttered with logs of POST /api/graphql requests. This is an actual issue of Next.js, see the related discussion here: vercel/next.js#65992.

This PR adds a workaround to filter out these logs by using grep in the sndev logs command.

Screenshots

before / after

image

Copy link
Member

@huumn huumn left a comment

Choose a reason for hiding this comment

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

-P isn't universal I guess: grep: invalid option -- P

Also this still logs GET requests: GET / 200 in 156ms. Is that as intended?

@riccardobl
Copy link
Member Author

Yes, that's intentional. I don't want to make the filter too broad to avoid the risk of filtering out legitimate logs. I'm focusing on filtering the graphql calls, as they are the primary source of pollution.

I've changed the command to not use -P, can you try it now?

@huumn huumn merged commit 1972af1 into stackernews:master Dec 31, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants