Made log parameter to environment optional.