Called at the beginning of a cron job. Checks for appropriate access permissions. Creates a database record for the logging messages. Note that this function opens an additional database connection, allowing logging to continue to work even if the main script is using transactions - which it should be.