Welcome! Log In Create A New Profile

Advanced

Re: Adding cachekey to log_format directive

November 16, 2012 12:23PM
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
Subject Author Posted

Adding cachekey to log_format directive

Wouter van der Schagt November 13, 2012 12:55AM

Re: Adding cachekey to log_format directive

gmccullough November 16, 2012 12:23PM

Re: Adding cachekey to log_format directive

Wouter van der Schagt November 23, 2012 11:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
Record Number of Users: 7 on October 18, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready