Added conditional logger to listener