Generate the code, upload is cli. Use a good editor or something lik that. I often use a shell on UNIX/LINUX or JUNOS machine.
To add loging to a policy you can do something like this:
set policy id <id>
set log
exit
So the shell code:
i=1
while [ $i -le <last policyid> ]
do
echo "set policy id $i"
echo "set log"
echo "exit"
i=`expr $i +1`
done
run the script, copy paste the output in the cli.
No way to do it easy in the cli.