Added required logging

Now the code will log its actions correctly