flush logger on dealloc and changing of sharedLog