OK, I'll admit it. You've completely confused me. I can't tell what you want where, and more particularly, I can't tell where the data to loadbuf is coming from.
loadbuf -r @log2 $line(@logviewer,$did(logviewer,4).sel)
Split that into 2 lines:
var -s %file $line(@logviewer,$did(logviewer,4).sel)
loadbuf -r @log2 %file
The -s will tell you what the variable %file is getting set to. Perhaps you need to quote that.
loadbuf -r @log2 $+(",$line(@logviewer,$did(logviewer,4).sel),")