Moved DATESTAMP refresh to the logging function.