Implemented logger middleware