I am using Spring Boot with Logback for logging. Currently, we have root logger set to DEBUG and then we have app package logger like com.abc.xyz
set to DEBUG.
Now, what's happening is all frameworks - Hibernate, Spring etc. are printing their DEBUG logs. What we want that all framework should print only WARN and below logs, so below are 2 options which I am thinking:
Option 1: Set the ROOT logger to WARN. However I am not sure what are its implications and even not sure whether it will help in achieving what I am looking for or not.
Option 2: Create specific loggers like org.springframework
and org.hibernate
and set them to WARN.
My questions:
- Which of the above approach is best way to have all framework logging to WARN level?
- If I set the ROOT logger to WARN then will it help? And what will be its other implications?
- Is it fine to set ROOT logger to WARN? Can it potentially cause to loose some application logging?