azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Azure Functions - Disable this log - "Sending HTTP request GET https//...."

Open Yashuaa opened this issue 3 years ago • 31 comments

Hi,

We make multiple http request, I don't want to see this puke

Sending HTTP request GET https://www.some-external-api.com....

How can I disable these logs?

I tried "logging:logLevel:Microsoft.Azure.WebJobs.Script.WebHost.Middleware.SystemTraceMiddleware": "None" and it didn't work..

For example I don't want to see these HTTP logs that are similar to this image

Yashuaa avatar May 25 '22 15:05 Yashuaa

bump

Yashuaa avatar May 25 '22 20:05 Yashuaa

hello?

Yashuaa avatar Jun 01 '22 15:06 Yashuaa

is anyone out there? *echoes *

Yashuaa avatar Jun 01 '22 15:06 Yashuaa

Imagine - a whole week - and not even a comment lol.

Yashuaa avatar Jun 01 '22 15:06 Yashuaa

hey, its me again

Yashuaa avatar Jun 03 '22 20:06 Yashuaa

Hi @Yashuaa 👋

Where are you seeing this log messages? How does your Logging or LogLevel settings configured? You should be able to update the log level for any logger category using these settings.

kshyju avatar Jun 03 '22 23:06 kshyju

Hi @kshyju . This is in Azure Functions Log Stream... I can't find out how to suppress... I've looked everywhere, I don't think it's possible to suppress just the request garbage and not EVERYTHING under the information category .... does that make sense ?

Yashuaa avatar Jun 04 '22 14:06 Yashuaa

@Yashuaa Can your host.JSON, specifically the logging portion of the JSON. Also, Is this is a V3 app or V4? In-proc or isolated?

kshyju avatar Jun 06 '22 21:06 kshyju

FYI here's a pretty good writeup of how to suppress various logs: https://github.com/anthonychu/functions-log-suppression

In addition to @kshyju's questions - I'm also curious what language this is for? (.NET/JavaScript/etc.)

ejizba avatar Jun 06 '22 23:06 ejizba

this is .NET 6 C# Azure Function v4 (the latest)

Yashuaa avatar Jun 07 '22 18:06 Yashuaa

@Yashuaa Can your host.JSON, specifically the logging portion of the JSON?

kshyju avatar Jun 07 '22 20:06 kshyju

sure..


    "logging": {
        "logLevel": {
            "Function": "Information",
            "default": "None"
        },
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,
                "excludedTypes": "Request"
            },
            "httpAutoCollectionOptions": {
                "enableHttpTriggerExtendedInfoCollection": false,
                "enableW3CDistributedTracing": false,
                "enableResponseHeaderInjection": false
            }
        }
    }

Yashuaa avatar Jun 08 '22 16:06 Yashuaa

Any ideas anyone? @kshyju

Yashuaa avatar Jul 14 '22 17:07 Yashuaa

I guess there is no way to do this unless you change the log level above Information, but then you suppress all of your logs.

Yashuaa avatar Sep 23 '22 17:09 Yashuaa