Added logging via db