question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Web App Service Logs Retention Days not set for Application Logging

See original GitHub issue

Reference this issue: https://github.com/Azure/azure-sdk-for-net/issues/9222

There are two log config classes here, ApplicationLogsConfig stands for Application Logging, and HttpLogsConfig stands for Web Server Logging.

Code snippet to set Application Logging Retention Days

         .WithApplicationLogging()
                .WithLogLevel(LogLevel.Verbose)
                .WithApplicationLogsStoredOnStorageBlob("sasToken")
                .WithLogRetentionDays(30)

Code snippet to set Web Server Logging Retention Days

     .WithWebServerLogging()
                .WithWebServerLogsStoredOnStorageBlob("sasToken")
                .WithLogRetentionDays(30)

Both above code snippets end up to call the same method WebAppDiagnosticLogsImpl(code as below).

 public WebAppDiagnosticLogsImpl<FluentT, FluentImplT, DefAfterRegionT, DefAfterGroupT, UpdateT> WithLogRetentionDays(int retentionDays)
        {
            if (Inner.HttpLogs != null && Inner.HttpLogs.FileSystem != null && Inner.HttpLogs.FileSystem.Enabled.HasValue && Inner.HttpLogs.FileSystem.Enabled.Value)
            {
                Inner.HttpLogs.FileSystem.RetentionInDays = retentionDays;
            }
            if (Inner.HttpLogs != null && Inner.HttpLogs.AzureBlobStorage != null && Inner.HttpLogs.AzureBlobStorage.Enabled.HasValue && Inner.HttpLogs.AzureBlobStorage.Enabled.Value)
            {
                Inner.HttpLogs.AzureBlobStorage.RetentionInDays = retentionDays;
            }
            return this;
        }

This method updates Retention Days of HttpLogsConfig. It should not update Retention Days of Application Logging, right? Update Retention Days of Application Logging should use ApplicationLogsConfig, right?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yaohaizhcommented, Jul 13, 2020
0reactions
weidongxu-microsoftcommented, Jul 15, 2020

next release would be 1.34.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Web App Service Logs Retention Days not set for ...
Describe the bug When setting the Application Logging Retention days, the value is not set (note that this is not a problem for...
Read more >
Set Retention Period for App Service logs in Azure ...
To my understanding the setting "retentionInDays" corresponds to "Retention Period (Days)" which can be found in the Azure Portal in the WebApp ......
Read more >
App service logs quota/retention period not working
I've configured my docker webapp to log to the File System and set the Quota to 100MB and Retention period to 11 days....
Read more >
Enable diagnostics logging - Azure App Service
Enable diagnostics logging for apps in Azure App Service ... In Retention Period (Days), set the number of days the logs should be...
Read more >
Structured Logging In Microsoft's Azure Application Insights
By default, the life span of logs in Azure Application Insights is 90 days, and it can go up to 730 days. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found