Add support for optional reference to log entries.