Add logging of slow queries and configuration.

You can now turn on and off query logging and slow query logging through connection parameters.