Logging a variable in a location?

Is there a way to log arbitrary text and the value of a variable in a
location directive? If so, how?

e.g.

The URI is $uri


Robert La Ferla
VP Engineering
OMS SafeHarbor

This message (and any attachments) contains confidential information and
is protected by law. If you are not the intended recipient, you should
delete this message and are hereby notified that any disclosure,
copying, distribution, or the taking of any action based on this
message, is strictly prohibited.