add processing to add log to taskqueue.
add a flag whether or not add log to taskqueue.