Linked Questions

Popular Questions

Azure Java SDK: How to disable logging to console?

Asked by At

I'm developing an application using Azure's Java SDK and Maven. This application sends data to an IoT Hub and some other functionalities that are not important for the scope of the question.
I implemented my own logging inside the application by using log4j2 and I'm fine with that since I can modify and change it however I want.

The problem arose when I checked this warning that was coming up in my application's console output:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.

Thanks to this SO question I was able to do the correct move and add the dependency inside my pom.xml file like so:

<project xmlns="" xmlns:xsi=""

After this addition the Azure's SDK started printing to console a lot of information that I don't really want to see. This should be the class that originates the logging.
Following, some output that gets written to console by itself.

Jun 07, 2018 8:09:18 PM LogInfo
INFO: IotHubConnectionString object is created successfully for, method name is <init>
Jun 07, 2018 8:09:19 PM LogInfo
INFO: DeviceClientConfig object is created successfully with, deviceID=device01 , method name is <init>
Jun 07, 2018 8:09:20 PM LogInfo
INFO: DeviceIO object is created successfully, method name is <init>
Jun 07, 2018 8:09:20 PM LogInfo
INFO: Setting SASTokenExpiryTime as 2400 seconds, method name is setOption_SetSASTokenExpiryTime

I've already tried to disable the Logger but with no success (followed this SO question).

I would like to know if someone has ever had this problem and if so how can I disable the logging features or else suppress the warning?
Thanks a lot in advance!

Related Questions