Azure Function (Spring Cloud): How to stop/reduce verbose Service Bus Logs?

Daniel 1 Reputation point
2022-11-24T08:32:23.997+00:00

Hello

Is there a way to reduce the amount of logs that are generated if I use a "@ServiceBusQueueTrigger" inside a Azure function with Spring Cloud?
e.g. I have this configured:
@ServiceBusQueueTrigger(
name = "message",
queueName = "handle-queue",
connection = "serviceBusConnection"
) message: String

And then, even before my Spring Context is loaded, the logs are hammered with such entries:
[2022-11-23T15:44:21.450Z] handle-queue-988b8f3f-da1b-4c0a-aeaa-2fd5c61f1f84-Receiver: ReceiveBatchAsync start. MessageCount = 1

Setting the root logger in logback-spring.xml to ERROR has no effect (as those logs are not happening in the Spring context).
Setting inside local.settings.json "AzureFunctionsJobHost__logging__logLevel__default": "Warning" stops those messages, but also stops all my own info logs, that I would like to have. So that can't be used.
And I haven't found any other way to affect this.

Help would be much appreciated

Kind Regards

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,978 questions
Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
124 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,426 Reputation points
    2022-11-29T07:53:43.583+00:00

    @Daniel Thanks for reaching out. You can configure the log level for the logging that controls the logging behaviors of the function app, including Application Insights.
    If you need only error to log, then you can configure the particular function app with Error.

    "logging": {  
        "fileLoggingMode": "debugOnly",  
        "logLevel": {  
          "Function.MyFunction": "Error",  
          "default": "None"  
        },  
        "console": {  
            ...  
        },  
        "applicationInsights": {  
            ...  
        }  
    }  
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.