'Logback.xml Same Package Log Different Level

I am using Slf4 for logging. I want to create two log file for the same package. INFO level log and DEBUG level log. I tried to implement like that

enter code here
<!-- User Friendly Application Logs -->
<logger name="com.example.app" level="INFO" additivity="true">
    <appender-ref ref="FILE" />
</logger>

<!-- Debug Application Log Level -->
<logger name="com.example.app" level="DEBUG">
    <appender-ref ref="DEBUG-FILE" />
</logger>

<!-- Console Root Log Level -->
<root level="INFO">
    <appender-ref ref="Console" />
</root>

I am missing a point because, I can see DEBUG level for all files. When I remove logger for debug, I never see the debug log in the ref="FILE".

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source