add dogstat logging to background tasks.