Added logging to disk and started log maintenance function