Using logger instead of printStackTrace