Save logs on the database