That depends on what you want...
If you want the raw cache key, it is stored as an array of strings (r->cache->keys) that must be concatenated together to populate the variable to log.
If you want the md5 hash of the raw cache key, it is available in two places:
The binary md5 value in r->cache->key, which would require using ngx_hex_dump to make it into a hexadecimal string to log.
A bit of a kludge, but the filename in the string r->cache->file.name contains it, but you'd have to backwards search it for the last '/' to get just the hash value.
Graham McCullough
Senior Software Engineer
Internap Network Services