Save messages on console terminate event.
Added setting cache key for commands.