TIL: Wanna test logging output in with logback and JUnit?

Just create a ListAppender and add it to the logger using logger.addAppender(myListAppender) in the unit test.

In the end you can go through the messages in the list appender and check your assertions. :)

Sign in to participate in the conversation

Gemütliche Mastodon-Instanz über dies und das :)