Implement additional arguments for log().

Fixes #5902