only logs to db if explicitly told to do it

to avoid the addition of redundant data to the db