Instantiate a logger in order to log.

Fixes #17762.