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

Requests logs shows incomplete, unhelpful URLs #52239

Closed
1 task done
raphaelbadia opened this issue Jul 5, 2023 · 4 comments · Fixed by #55111
Closed
1 task done

Requests logs shows incomplete, unhelpful URLs #52239

raphaelbadia opened this issue Jul 5, 2023 · 4 comments · Fixed by #55111
Assignees
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked

Comments

@raphaelbadia
Copy link
Contributor

raphaelbadia commented Jul 5, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

yarn run v1.22.19
$ /Users/raphael/code/billiv/billiv-frontend/node_modules/.bin/next info

    Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020
    Binaries:
      Node: 18.16.0
      npm: 9.5.1
      Yarn: 1.22.19
      pnpm: 7.25.1
    Relevant packages:
      next: 13.4.2
      eslint-config-next: 13.3.1
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.4

warn  - Latest canary version not detected, detected: "13.4.2", newest: "13.4.9-canary.1".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue
✨  Done in 2.57s.

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/raphaelbadia/nextjs-appdir-truncates-logs

To Reproduce

Use fetchs with long URLS, such as


export default async function Home() {
  await fetch(
    "https://jsonplaceholder.typicode.com/posts/1/comments?url=too_long&truncated=unfortunately_yes"
  );
  await fetch(
    "https://jsonplaceholder.typicode.com/posts/1/comments?url=too_long&hello=false&truncated=unfortunately_yes"
  );
  return null;
}

Describe the Bug

When I use fetch, the requests are logged in the terminal.

This is a great idea, but they are truncated and I can't differentiate them:

CleanShot 2023-07-05 at 11 32 04

Here I don't understand why my edge config gets called twice, is it the same call? I can't know.

Same for my 6s slow request, In my code I have two different queries but I don't know which one is which.

Expected Behavior

I'd like to be able to see the full URL in the terminal.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1604

@raphaelbadia raphaelbadia added the bug Issue was opened via the bug report template. label Jul 5, 2023
@raphaelbadia
Copy link
Contributor Author

This is where I'm at today.

CleanShot 2023-08-22 at 10 53 36

@matbee-eth
Copy link

matbee-eth commented Aug 31, 2023

I would also love this to be reviewed- atleast only truncate the common URL components

@matbee-eth
Copy link

image

@huozhi huozhi added the linear: next Confirmed issue that is tracked by the Next.js team. label Sep 7, 2023
@huozhi huozhi self-assigned this Sep 7, 2023
@kodiakhq kodiakhq bot closed this as completed in #55111 Sep 7, 2023
kodiakhq bot pushed a commit that referenced this issue Sep 7, 2023
Fixes #52239
Closes NEXT-1604

Change the logging option to object for flexibility
```js
experimental: {
  logging: {
    level: 'verbose', // control log level
    fullUrl: true, // console fetching url logging
  }
}
```

### After vs Before
<img src="https://github.com/vercel/next.js/assets/4800338/e0a05e2d-b69e-4075-afe1-8179c827f548" width="400">
<img src="https://github.com/vercel/next.js/assets/4800338/89a73ae3-1999-49ac-86f0-2c7248adc22c" width="400">
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants