simple logging middleware