Search code examples
azurenext.jsazure-application-insightsnext.js13azure-static-web-app

Where is the server log for nextjs app runnning in azure static web apps?


I have successfully deploy a nextjs 14 app with azure static web apps. On some pages i get an server error:

> Application error: a server-side exception has occurred (see the
> server logs for more information).

Where can i find this information? I have activated app insight.


Solution

  • Where can i find this information? I have activated app insight.

    Once you get the application error or exception navigate to the application insight. enter image description here

    • Go to Investigate<Transaction search<check the exception trace (error log trace).

    enter image description here

    • Click on View to logs and follow the below query for the error log.
    union isfuzzy=true
        exceptions,
        pageViews,
        traces,
        dependencies
    | where timestamp > datetime("2024-04-09T10:13:28.407Z") and timestamp < datetime("2024-04-10T10:13:28.407Z")
    | order by timestamp desc
    | take 100
    

    Exception logs:

    enter image description here