Added logging database table.
Added logging to the main 3 files.