Logging refactoring

Logging refactoring complete