What is the limit of Azure webjob logs?

Deep 26 Reputation points
2021-06-15T10:08:46.927+00:00

As per https://github.com/projectkudu/kudu/wiki/WebJobs

I know that WEBJOBS_HISTORY_SIZE - Maximum number of runs kept in the history directory for a triggered job. The default is 50.

But what is the maximum number of logs that can be allowed in history?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,971 questions
0 comments No comments
{count} vote

Accepted answer
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2021-07-02T20:42:50.3+00:00

    Hi @Deep

    I heard back from the engineering team and they said there isn’t a hardcoded maximum.

    kudu/DeploymentSettingsExtension.cs at master · projectkudu/kudu (github.com)

    public static int GetWebJobsHistorySize(this IDeploymentSettingsManager settings)  
        {  
            string value = settings.GetValue(SettingsKeys.WebJobsHistorySize);  
            int maxJobRunsHistoryCount;  
            if (Int32.TryParse(value, out maxJobRunsHistoryCount) && maxJobRunsHistoryCount > 0)  
            {  
                return maxJobRunsHistoryCount;  
            }  
      
            return DefaultMaxJobRunsHistoryCount;  
        }  
    

    There would be a balance between setting higher numbers for these values and not consuming too much disk space.

    An alternative is to consider enabling Application Insights logging: Tutorial for event-driven background processing with the WebJobs SDK - Azure App Service | Microsoft Learn

    Hope that helps.

    Best,
    Grace

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.