Update logger.php

Added a check to remove directories from get_logs().