# How to log only if $upstream\_cache\_status is not equal to "HIT"

**URL:** <https://www.ruby-forum.com/t/how-to-log-only-if-upstream-cache-status-is-not-equal-to-hit/219177>\
**Category:** NGINX\
**Created:** [April 22, 2012, 11:49pm UTC](https://www.ruby-forum.com/t/how-to-log-only-if-upstream-cache-status-is-not-equal-to-hit/219177 "2012-04-22T23:49:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 22, 2012, 11:49pm UTC](https://www.ruby-forum.com/t/how-to-log-only-if-upstream-cache-status-is-not-equal-to-hit/219177/1 "2012-04-22T23:49:50Z")

</div>

Hello,

Iam trying to find out if there is a way I can have an access logs only  
for the objects that did not produce a HIT from the cache (recorded in  
the nginx $upstream\_cache\_status var)

Is this possible?

Thanks and regards,  
Joseph
