Fixed logging method