Make logging path optional with fallback to console output