Better logging to logfile