https://github.com/barabo/advanced-shell-history
https://github.com/tkf/rash
both are fairly featureful and capture additional metadata about the commands run
it is also possible to use similar tools to log your bash history to mysql, or to syslog, which may be preferable for auditing purposes.