I forgot to enable the firewall initially and left out the 2nd iptables-save command. Please use this test case instead:
$ sudo ufw enable
$ sudo iptables-save|grep '^-.*logging' | wc -l
12
$ sudo ufw disable
$ sudo sed -i "s/^ENABLED=.*/ENABLED=yes/" /etc/ufw/ufw.conf
$ sudo /lib/ufw/ufw-init start
$ sudo iptables-save|grep '^-.*logging' | wc -l
8
The output of the two iptables-save commands should be identical.
UPDATED TEST CASE
I forgot to enable the firewall initially and left out the 2nd iptables-save command. Please use this test case instead: .*/ENABLED= yes/" /etc/ufw/ufw.conf
$ sudo ufw enable
$ sudo iptables-save|grep '^-.*logging' | wc -l
12
$ sudo ufw disable
$ sudo sed -i "s/^ENABLED=
$ sudo /lib/ufw/ufw-init start
$ sudo iptables-save|grep '^-.*logging' | wc -l
8
The output of the two iptables-save commands should be identical.