Fix issue when errors are thrown before logger exists
legacy support
corrected wrong merge