This can be done by the configuration command "aaa accounting command". This command was available but had no effect in earlier IOS releases (prior to 11.2) and was introduced in some 11.2 release.
Another way to achive this which also works with pre-11.2 IOS releases is to enable command authorization and use the daemon's authorization traces to get the desired information.