Adding logging on lifecycle methods.