3.0 database log

Query logging in new database layer