Logging now working properly