Request Id for logging purposes

Igal @ getRailo.org igal at getrailo.org
Wed Feb 4 19:22:48 UTC 2015


thank you for your prompt reply.

yes, it works in the server section, but my access_log is in the http
section, and I want to use it in the access_log

should I just add

    *access_log* |off|;

in the http section and add the access_log to the server section instead?

thanks


On 2/4/2015 11:15 AM, Francis Daly wrote:
> On Wed, Feb 04, 2015 at 11:07:13AM -0800, Igal @ getRailo.org wrote:
>
> Hi there,
>
>> I want to be able to identify requests by a unique id. 
>>
>> I'm able to do this in the location section:
>>
>>         proxy_set_header    X-Request-Id       
>> $pid-$msec-$remote_addr-$request_length;
>>
>> but I want instead to set it to a variable, e.g. in the http section:
>>
>>     set $request_id $pid-$msec-$remote_addr-$request_length;    ## does
>> this work?
> http://nginx.org/r/set
>
> No.
>
> It can be at "server" level, though.
>
>>     add_header      X-Request-Id    $request_id;    ## I don't see it in
>> the response headers
> You probably were not running with this configuration.
>
>> can it work?
> With "set" at server{} level, yes.
>
> All of the normal nginx configuration directive rules apply.
>
> 	f

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150204/99e949b6/attachment.html>


More information about the nginx mailing list