fixed npe in logger.