1

I am using Consumption plan hosted Azure Functions (Java) with below settings in host.json -

{
    "version": "2.0",
    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[2.*, 3.0.0)",
        "functionTimeout": "00:10:00"
    }
}

FUNCTIONS_EXTENSION_VERSION ~ 4

I have also configured logback with below XML -

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="info">
    <appender-ref ref="STDOUT" />
  </root>
</configuration>

With these configurations in place, I was expecting only INFO logs from my function app as well as all the third party libraries I am using would be visible in App Insights. But I can see DEBUG logs as well from the third party libraries my function is using with App Insights.

What is the correct way to disable DEBUG/TRACE logs in App Insights from the third party libraries my JAVA function depends on?

Regards
Jacob

Jacob
  • 426
  • 3
  • 19
  • I have put my `logback.xml` in my src/main/resources/. So that it gets packaged along and it works as expected – Jatin Aug 25 '22 at 10:06

1 Answers1

0

you can add this values in host.json file. and this values disable dependency tracking.

"enableLiveMetrics": false,
"enableDependencyTracking": false,
"enablePerformanceCountersCollection": false,

More information read this article # Disable tracking dependencies in Azure Function Application Insights by Andrew Leader

  • actually all the DEBUG logs from third party libraries like hikari, hibernate-validator are all getting logged with event type as "trace", category as "Host.Function.Console" which is exactly same for the normal function INFO logs that I want to log. I don't see many "dependency" events (only one is from DB calls). On local I can see only INFO logs from these libraries but in app sights everything is getting exported – Jacob Aug 23 '22 at 11:27