My web app keeps crashing and I want to get the NODE JS errors. I don't see App Service logs under monitor, how can I access this logs for errors related top NODE JS?

Sam Sadeghian 0 Reputation points
2024-12-05T16:43:51.6366667+00:00

My web app keeps crashing and I want to get the NODE JS errors. I don't see App Service logs option under monitor as Azure support page describes, how can I access this logs for errors related to NODE JS?

Ignore the tags, I randomly selected since no relative tags were available to select.

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
156 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,021 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 1,600 Reputation points Microsoft Vendor
    2024-12-06T14:04:36.2633333+00:00

    Hi Sam Sadeghian
    Hi ,Welcome to the Microsoft Q&A Platform!
    If your Azure App Service logs are not visible under the "Monitor" section, you can enable diagnostics and access logs for Node.js errors.

    1. Navigate to Azure portal> App Service > Diagnostics Settings.
    2. Turn on Application Logging it should stored logs temporarily (12 hours).
    3. Application Logging (Blob) will Retained in a configured storage account.
    4. Use Error or Verbose for detailed logs.
      Use Azure CLI for logs to access.
    az webapp log download --name <AppServiceName> --resource-group <ResourceGroupName>
    
    1. Visit: https://<your-app-name>.scm.azurewebsites.net.
    2. Go to Debug Console > LogFiles > Application > nodejs folder.
    3. App Service > Log Stream under the Monitoring section.
    4. Application Logging (Filesystem) must be enabled.
    5. Ensure your app outputs logs via stdout or stderr.
    6. Link Application Insights to your App Service for detailed telemetry.
    7. Enable Live Metrics for real-time logs and performance monitoring.
    8. Ensure Node.js outputs errors via console.error.
    9. Add DEBUG or NODE_ENV=development in the App Service configuration.
    10. Azure Monitor > Logs.
         AppRequests 
         | where Resource == "<YourAppServiceName>"
         | project Timestamp, StatusCode, Message
         
      
      If this answers your query, do click Accept Answer and Yes for was this answer helpful.
    0 comments No comments

  2. emily white 0 Reputation points
    2024-12-12T09:44:14.09+00:00
    1. Enable Logs:
      • Go to App Service > Monitoring > App Service Logs.
      • Enable Application Logging (Filesystem) and set it to Error.
      • Click Save.
    2. Access Logs:
      • Go to Development Tools > Advanced Tools (Kudu).
      • Open Debug Console > CMD.
      • Navigate to D:\home\LogFiles\ for stdout or stderr logs.
    3. Stream Logs:
      • Go to Monitoring > Log Stream to view real-time logs.
    4. Optional (Detailed Logs):
      • Enable Application Insights for additional telemetry.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.