skip to Main Content

I have a next.js application running in an Azure container app.
The container app has a "log stream" feature. In this view I can see that the next.js application is starting up:

  ▲ Next.js 14.2.3
  - Local:        http://localhost:3000
  - Network:      http://0.0.0.0:3000
 ✓ Starting...
 ✓ Ready in 75ms

This looks almost identical to the output when I run locally.

After this I expect a lot of log entries from my own code. But nothing more shows up in the log. When I run locally, the logging from my own code is working fine.

I am simply using console.log(). I have also tried console.info(), console.error(). I found the next.js framework code that I believe logs the lines above. They seem to be using console.log().

Is my code running as a child process and do I have to do something actively to pipe the stdout and stderror so they will show up in the output?

2

Answers


  1. After this I expect a lot of log entries from my own code. But nothing more shows up in the log. When I run locally, the logging from my own code is working fine.

    It takes up to 60 Seconds to get the logs in log stream.

    You can follow the same approach as below to get the requirement done

    I have created sample Next.js application and added sample log in the code.

    • I have tried this command npx create-next-app@latest my-nextjs-app.
    • After ran the application getting the error logs like below in local.

    enter image description here

    enter image description here

    I have pushed the application into azure container registry successfully. check below:

    enter image description here

    After running the application with container app URL getting like below:

    enter image description here

    In log stream getting the error logs successfully. check below:

    Output:

    enter image description here

    In the end you can see the Error logs after 60 seconds.

    Login or Signup to reply.
  2. Did you ever find the answer? I’m having the same problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search