vercel / next.js

The React Framework
https://nextjs.org
MIT License
121.28k stars 25.95k forks source link

Maximum of 255 logs per api method invocation 😭 #65253

Open MaximusMcCann opened 2 weeks ago

MaximusMcCann commented 2 weeks ago

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/sharp-sara-zvwn7d?file=%2Fapp%2Fapi%2Ftest-logging%2Froute.ts%3A6%2C3

To Reproduce

  1. Create an api endpoint and put the below code in it.
  2. Deploy said code.
  3. Call the endpoint.
  4. Watch logs and see Vercel caps at 255 logs per invocation, why!?
    for (let i = 0; i < 1000; i++) {
      log.debug('same method log count: ', i)
    }
Screenshot 2024-05-01 at 11 55 53 PM

Current vs. Expected behavior

Current: caps at 255 logs :( Expected: not to cap at any number of logs. We run a cron job and it should be listing 1-2k logs, but just gets cut at 255 😭

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.21
  pnpm: N/A
Relevant Packages:
  next: 14.1.4
  eslint-config-next: 14.1.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Runtime

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

No response