There are no docs to be found on Logging. Also, the default configuration for production doesn't output access logs.
Search official docs and observe there is nothing about logging.
I expect to see extensive docs about logging.
Also, I expect to see access logs in my docker/kubernetes pod logs by default.
Related issue #5512
If you're going to self-host it's your own responsibility to set up access logging, just like any other Node.js application, hence why there is no section on it in the Next.js docs.
Thanks for the information.
Just a bit of feedback: Self-hosting appears to be a second class citizen in Next.js and the bar for what is considered Advanced/Custom (AKA "Unmounted") seems to be really low. I'm 5 hours into a new Next.js project and it seems like everything I want to do is considered custom/advanced.
Is there a more complete "framework" that wraps Next.js?
Self-hosting appears to be a second class citizen in Next.js
Not really, setting up Node.js servers / proxies etc is just not what Next.js handles. Next.js is the application itself.
What you're asking about in particular is related to infrastructure (access logging is generally what happens in a proxy, Next.js is not a proxy).
The literal steps to get boot up the production server when self hosting are next build && next start
, this boots up a production-ready Node.js server on localhost port 3000, which is a pretty low bar for self hosting as you don't even have to figure out how to set up a Node.js server framework like express.
the bar for what is considered Advanced/Custom (AKA "Unmounted") seems to be really low
What are you talking about in particular? Next.js covers a lot of different use cases and the docs have to tailor to both beginners / more advanced use cases hence why there's an advanced subsection. Advanced doesn't mean unmounted / ejected.
Is there a more complete "framework" that wraps Next.js?
Not sure what you're looking for Next.js to handle, as said access logs are generally not handled in the Node.js layer, especially as Next.js is hybrid with static files: https://nextjs.org/docs/basic-features/pages.
While I agree somewhat with @timneutkens sentiment here:
If you're going to self-host it's your own responsibility to set up access logging, just like any other Node.js application, hence why there is no section on it in the Next.js docs.
I disagree on a deeper level when we don't have access to the lifecycle methods of what happens when rendering pages. Similar issues/PRs have been opened (such as #1852, https://github.com/zeit/next.js/compare/canary...djskinner:newrelic) which are all focused on APM, Logging, Performance Monitoring, Error Tracing, etc. When using NextJS OOTB (no custom server, using api pages, etc), there is pretty much no way to monitor the internals. Errors get swallowed up by internal Next infrastructure, reporting on things like long tasks, or just defining logging as a global, isomorphic layer, is hard and complex.
Right now I am having to create message queues and send them as a transport layer across the server->client->server in order to get even a small amount of visibility into the application performance/problem areas. From an enterprise level, this is unacceptable. If there was a section in examples, or some direction from the NextJS team, that would be awesome.
Most helpful comment
While I agree somewhat with @timneutkens sentiment here:
I disagree on a deeper level when we don't have access to the lifecycle methods of what happens when rendering pages. Similar issues/PRs have been opened (such as #1852, https://github.com/zeit/next.js/compare/canary...djskinner:newrelic) which are all focused on APM, Logging, Performance Monitoring, Error Tracing, etc. When using NextJS OOTB (no custom server, using api pages, etc), there is pretty much no way to monitor the internals. Errors get swallowed up by internal Next infrastructure, reporting on things like long tasks, or just defining logging as a global, isomorphic layer, is hard and complex.
Right now I am having to create message queues and send them as a transport layer across the server->client->server in order to get even a small amount of visibility into the application performance/problem areas. From an enterprise level, this is unacceptable. If there was a section in examples, or some direction from the NextJS team, that would be awesome.