Backing up only some files means a list of names, and the usual way to build one is find. Passing that list to tar is where file names with odd characters start to bite.
find logs -name '*.log' -print0 | tar --null -T - -czf logs.tgz
find -print0 ends each name with a NUL byte instead of a newline. -T - tells tar to read the names to archive from standard input, and --null says those names are NUL terminated. The help text adds that --null implies --verbatim-files-from, so the names are taken literally.
The test folder had a file called app one.log and one with a newline in the middle of its name. The archive listed all of them, and cat -A shows the newline as \n:
logs/odd\nname.log$
logs/app2.log$
logs/app one.log$
With a plain newline separated list, find logs -name '*.log' | tar -T - -cf bad.tar, the name with spaces still worked. Only the one with the newline broke:
tar: logs/odd: Cannot stat: No such file or directory
tar: name.log: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
The odd name is rare, and I’d still use the NUL form out of habit, since it costs nothing.
A caveat about a neighbour option: --remove-files deletes each file after it is added to the archive. Combined with this pipeline it turns a backup into a move. In the test folder it left only keep.txt, the file the pattern did not match. Run the command once without it, and list the archive with tar -tzf, before you let it delete anything.
Further reading: GNU tar manual