Search code examples
javaspringspring-bootslackslack-api

How to disable logging in imported libraries?


In my application, I am using SLF4J's Logger for logging. When an error is logged, I am sending a message to another application. The problem is that one of the libraries I use (Slack API) uses the same logger (in class com.slack.api.methods.impl.TeamIdCache), so when it logs an error, my application sends a message that I didn't intend it to send.

How can I disable that library's logger?


Solution

  • You can disable specific logger in your application properties:

    logging.level.com.slack.api.methods.impl.TeamIdCache=OFF
    

    See Spring documentation for more information regarding other configuration options and log levels.