Just to clarify this a bit, the first redirection (>cmd.log) redirects stdout (1) output ("normal things", like echos etc.) to the given file, and the second (2>&1) redirects stderr (2) to where ever stdout is going (&1 means "where 1 [stdout] goes"). For this to work properly in this case, stdout has to be redirected first, and stderr second (read: the one that is redirected with & is redirected second, to make it go right), because if it was done the other way around, stderr would go to terminal (where stdout usually goes) and stdout to the file; this is because the shell interprets these from left to right.
Hope it clarified it a bit. It's also possible to direct outputs to variables and then use those variables in shell scripts, for example. It's not difficult either, but slightly more complicated than "normal" redirecting. Usual sometimes, though!