Add new log level OFF. See #2965

This is a forward port to master.
This includes the fixed test from ticket 3069.