added log table, and modified logs to write there