Extract access log into middleware