Fix logging flag for serialization