2

I have 10+ azure function apps deployed. Out of them only one function app always writes a trace message "Executing HttpStatusCodeResult, setting HTTP status code 200" every 10 seconds. I can not find the source from where this log is coming. My host.json looks like below

{
  "version": "2.0",
  "logging": {
    "fileLoggingMode": "debugOnly",
    "LogLevel": {
      "Default": "Information"
    }
  },
  "extensions": {
    "http": { "routePrefix": "api" }
  }
}
DevMJ
  • 331
  • 1
  • 5
  • 17
  • is it a httptrigger function, right? Even if you didn't run the function, is the trace message still sent? – Ivan Glasenberg May 19 '20 at 03:02
  • Yes the trace message still appears even if I am not triggering the function. Btw I am not writing this log message anywhere in my function app. – DevMJ May 19 '20 at 04:01
  • The trace message is auto-generated by the function host(not a function instance like a httptrigger function). Can you create another httptrigger function and see if the trace there? – Ivan Glasenberg May 19 '20 at 05:17
  • I have around 13 function apps deployed. And all of them have many http triggered functions. But out of them only one function app is writing these traces. And that is where I am confused. – DevMJ May 19 '20 at 07:05
  • Another possible reason is that the message indicates the health check is in progress. But not sure why it only occurs for this one. – Ivan Glasenberg May 19 '20 at 07:38
  • @DevMJ I have the same issue, did you found which route was causing this? – Sergio Jr Dec 23 '22 at 09:26

3 Answers3

0

A possible reason is that the message indicates the health check is in progress. But I'm not sure in which condition it will do the check.

This should not impact the function. And if you want to find out the root cause, it's better to raise a support ticket, the support team may check the backend for the reason.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
0

When you have some unwanted logs in application insights, click on it and see what's the category:

Trace

As you can see, the category is Microsoft.AspNetCore.Mvc.StatusCodeResult and the severity level is Information.

What I did was to ignore all the logs with lower level than Warning from all the categories starting with Microsoft. I configured it in the host.json file:

{
  "version": "2.0",
  "logging": {
    "fileLoggingMode": "always",
    "logLevel": {
      "default": "Information",
      "Host.Controllers.Host": "Warning",
      "Microsoft": "Warning"
    }
  }
}

As you can see, I also set Warning value to Host.Controllers.Host to avoid messages like Ping Status: { "hostState": "Running" }

Dharman
  • 30,962
  • 25
  • 85
  • 135
cryss
  • 4,130
  • 1
  • 29
  • 34
0

I had the same issue. Are any of your functions marked with the [Disabled] attribute, or disabled in the portal? I have a feeling that the framework performs some kind of health check on them. After I removed the [Disabled] functions from my code, the health check messaging stopped.