Converted logging to var log