use php error_log if logger is not set

Resolves #8956
Its the same code block 5 times, better put it into a method?