Add logging to processing function.