This logback configuration is an example of diverting debug level logs for a specific package to a separate file, while maintaining info level in the main log. This allows viewing all package logs in context, and then when an info or warn level log appears, you can switch to the debug log and see that line in context with debug statements.
This is particularly useful for debugging a new or troublesome package in production without cluttering up your main log stream.
The main
appender is the primary appender to which all application logs are
sent. The stream-debug
appender is only referred by the app.component.stream
package. The key configuration of the appenders is the ThresholdFilter. That
ensures that even though the app.component.stream
is elevated to debug level
output, the main
appender will only write out at the info level while the
stream-debug
appender will send debug level through.