echo $(date) >> $HOME/logout.log
can be replace by
date >> $HOME/logout.log
.bash_logout is run when you disconnect, not when there is a reboot.
A reboot is when you restart host, effectively killing (more or less nicely) all it process, database, webserver and so on.
A logout is when you (or any user) disconnect from interactive session, the host stay up, as well as database and the like.
If you want script to be executed during a schedule shutdown, place then in
/etc/init.d , then have a link like
/etc/rcX.d where X is your run-level (result of
Be aware that unexpected shutdown (power outage, disk I/O freezing) will leave no trace in log file.