[QUERY] How to stop function log spam in console app for .NET 6 / V4 functions
See original GitHub issueLibrary name and version
Azure.Messaging.ServiceBus 7.5.1
Query/Question
Previous version (NET Core 3.1), we could watch the consoles and follow app behavior, now almost all of the console output is functionally spam.
I want to filter out
[2022-02-01T23:49:22.524Z] topic/Subscriptions/function-480d862d-84c0-4355-b2ca-3617ee49eb8f: ReceiveBatchAsync done. Received '0' messages. LockTokens =
[2022-02-01T23:49:23.876Z] topic/Subscriptions/function-480d862d-84c0-4355-b2ca-3617ee49eb8f: ReceiveBatchAsync start. MessageCount = 1
Which occur at least 100 per function and
[2022-02-01T23:52:30.582Z] Request [1a524b29-cbb5-4e18-aa28-cc84d04e08b0] PUT http://127.0.0.1:10000/devstoreaccount1/azure-webjobs-hosts/locks/user-858520082/host?comp=lease
[2022-02-01T23:52:30.587Z] x-ms-lease-action:renew
[2022-02-01T23:52:30.587Z] x-ms-lease-id:0000000000000000000000002C8741E3
[2022-02-01T23:52:30.588Z] x-ms-version:2020-08-04
which is less frequent but still relatively significant pollution.
I’ve tried modifying the host.json from Default “debug”, to only display information
"logging": {
"logLevel": {
"Default": "Information",
"System": "Information",
"Microsoft": "Warning"
}
}
and it didn’t reduce logging, and I’m afraid that if we reduce the logging level further that we’re just going to be obfuscating the information we want, because we used to be able to see when a function picked up a message and then when it marked it as complete, as well as internal logging data.
Environment
.NET 6 VS 2022
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Stop an Azure Function from logging the “Executing” and “ ...
Go to Azure portal, Platform features> Function app settings> host.json ... which means we can still see them in console or file logs....
Read more >Guide for running C# Azure Functions in an isolated worker ...
Learn how to use a .NET isolated worker process to run your C# functions in Azure, which supports non-LTS versions of .NET and...
Read more >Logging query language
You can use the Logging query language in the Logs Explorer in the Google Cloud console, the Logging API, or the command-line interface....
Read more >Debugging Azure Functions
Provide a developer's overview on how to debug your Azure Functions locally or against a remote Azure.
Read more >How to enable verbose logging for Azure Functions?
This post describes how you can easily enable debug/verbose information for your Azure Functions for a lightweight and built-in way to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Prinsn. Thank you for reaching out. To change the log detail that you’re seeing for Service Bus or other Azure SDK packages, you’ll need to configure their levels independently. For example, if you wanted to restrict Service Bus to just warnings and errors, you’d use something similar to:
There’s a bit more context in the discussion on #25865, if you’re interested.
You and Josh are really doing serious work with this repo.