I usually don't test the logging. However, sometimes I get tests for the logging messages "for free". That happens when I break out some logic in its own function, and I want logging on what happened in that function (definitely not all the time, but is sometimes useful). Then the function can return its result, and a list of logging messages to output. When asserting the result, I can also assert on the logging messages.<p>It's what I describe in "Returning a message list" in this post: <a href="https://henrikwarne.com/2020/07/23/good-logging/" rel="nofollow">https://henrikwarne.com/2020/07/23/good-logging/</a>