Correct way to set log level for azure functions java logback

Viewed 61

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

1 Answers
Related