add try except to logger