Web Job logs issue

Muhammad Abdullah 0 Reputation points
2025-02-07T10:42:59.7666667+00:00

we have some web jobs in webapp and it is configured to send all logs to Analytic works space . It is sending the predefined logs like status of web jobs to the workspace but we can not see the specific logs(that are attached in the web job section along

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,068 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 3,125 Reputation points Microsoft Vendor
    2025-02-10T17:47:38.8833333+00:00

    Hi @Muhammad Abdullah ,
    Thanks for the question and using MS Q&A platform.
    Apology for the Inconveniences.
    Sending .txt log files from your web jobs to Azure Log Analytics is very convenient.

    Make sure that App Service diagnostic configuration is done to send predefined logs for Web Jobs status to Log Analytics.

    Automate the process of reading the log files on a periodic basis and send the content of the .txt file to Log Analytics.

    Use Azure Monitor REST API or Azure SDK to send your logs.

    Using Azure Monitor Data Collector API .

    In Log Analytics, these logs can be queried through Kusto Query Language (KQL).

    AppServiceWebJobs
    | where FileName contains "logfile.txt" // Replace with actual log file name
    | project Timestamp, LogMessage
    

    An azure function can be set up or use a script as a task in a cron job to automatically transfer the logs stored in the Web Jobs .txt files to Log Analytics.

    And perhaps a Timer Trigger in Azure Functions can be used for log uploads frequently.
    Let me know if you have further assistances.

    Ingest data into Log Analytics
    Troubleshoot common Azure Spring Apps issues

    Monitor Azure Web PubSub

    How to enable Azure Storage Mover copy and job logs

    Quickstart: Analyze logs and metrics in the Azure Spring Apps Standard consumption and dedicated plan


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.