log message in db