Adding Logging component fix and refactoring

Fixed the mistake.