Check that the logger exists before logging.

Crashed for me otherwise when testing methods directly using Rack::Test.