How to write logs for certain tasks only?
It's in the wish list, I think. Quoting from the doc log_plays - write playbook output to log file

* This callback writes playbook output to a file per host in the /var/log/ansible/hosts directory
* TODO: make this configurable


IMHO required functionality is not available at the moment. Take a look at the available plugins. "You can only have one plugin".

ansible-doc -t callback -l


There is an option to customize a callback. context_demo looks promising.