An alternative to Aaron's solution would be to configure a WriterAppender with an attached StringWriter. At the end of the test, you can verify the contents of the log output string.
This is a bit easier to implement (no need for custom code), however is less flexible with regards to checking the results, as you only get the output as plain text. In some cases that may make it more difficult to verify the output than with Aaron's solution.