will the parameter %t also perform log rotation for collecting GC logs?
%t
-Xloggc:/data/logs/gc-%t.log
You should enable logging by unlocking -XX:+UseGCLogFileRotation
-XX:+UseGCLogFileRotation
See also Rolling garbage collector logs in java