Made logging setup more flexible