Make logginglevel setting resistant to failure