How to capture console output from Webjob to Log Analytics Workspace

DUMITRASCU Claudiu-Alexandru 0 Reputation points
2024-11-19T15:28:35.9233333+00:00

Hello,

We have an App Service that is running a continous Webjob consisting of a .Net framework application. We would like to capture the output seen in Web job console and have it in Log Analytics workspace .
Specifically we want both Kudu messages about the webjob starting/stopping, job directory change detected etc and application standard output to be captured to Log Analytics workspace .

Here are the steps taken so far:

  1. We have enabled in Diagnostic settings App Service Console Logs to be sent to Log Analytics workspace. They are both in the same subscription

2.We have set Application logging (Filesystem) to On and Level Verbose

Nothing appears in the Log Analytics workspace. What step might be missing?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,120 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,039 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Kunev 1 Reputation point
    2024-11-26T15:22:42.7966667+00:00

    Hi Claudiu-Alexandru,

    In order to see logs, you also need to enable "App Service logs" (under Monitoring category in the Web App) and set

    • Application Logging (Filesystem)" to "On"
    • the "Level" to "Verbose"

    Then in Log Analytics Workspace, run the following query to verify the application logs:

    AppServiceConsoleLogs
    | where Resource == "YourAppServiceName"
    | sort by TimeGenerated desc
    
    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.