Controller and Database logging working