Handle null values in logging