Added the LogWriter code. This should work for our usecase. Might need
some finer changes later.