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
SubjectAuthorPosted

Adding cachekey to log_format directive

Wouter van der SchagtNovember 13, 2012 12:55AM

Re: Adding cachekey to log_format directive

gmcculloughNovember 16, 2012 12:23PM

Re: Adding cachekey to log_format directive

Wouter van der SchagtNovember 23, 2012 11:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 63
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready