log using apache log funcitons to correct format. Fixes #788