Added a configurable output directly to the database. Kept in the file output for debugging purposes