I use the following found zsh function to log each each command to file by date. I've definitely found value in looking up less frequently used or complex commands.
# Custom history logging # From: http://blog.andrewhays.net/love-your-terminal # https://web.archive.org/web/20130525150720/http://blog.andre... function precmd() { if [ "$(id -u)" -ne 0 ]; then FULL_CMD_LOG="$HOME/.shlogs/zsh-history-$(date -u "+%Y-%m-%d").log" echo "$USER@`hostname`:`pwd` [$(date)] `\history -1`" >> ${FULL_CMD_LOG} fi }