adding logging info/null checking to logged JSON