refactored log monitor with composition