A simple logging handler and middleware implementation.