Changed logging a bit
Added LogWriter for log file generation.