Useful to add the given url in the error message also. So you could say : logger.error("Invalid url: %s", url)