Just pass query parameters to log_queries subroutine.