Two of the essential properties of logarithms are that $$\log_a xy = \log_a x + \log_a y$$ and the property which follows from it $$\log_a x^y = y \log_a x$$ Therefore, as long as you are willing to add, subtract and maybe multiply, you can get the logarithm of any composite number using the logarithm of its prime factors.
In the logarithm tables I've seen, however, the logarithms $\log_a x$ are listed out for $x=0.01,0.02,0.03,0.04,...$ etc. in an arithmetic progression. This trades space (which would allow for more logarithms to be recorded, and hence greater range of numbers that could be calculated accurately) for speed and simplicity (avoiding the addition, subtraction, etc. to get the desired logarithm from its "prime factors").
I haven't yet seen a table with only primes. Did speed and convenience generally outweigh accuracy and information density, or is there more to the story?