Welcome! Log In Create A New Profile

Advanced

$local_time variable doubt!

Posted by lockyZ 
$local_time variable doubt!
December 01, 2016 09:36AM
Hello guys,

From what I understood $local_time variable shows the timestamp when NGINX record on log which means that it includes the response from the other server, I'm currently on a middle of a problem and I need the actual timestamp NGINX receive the message. Is there any way for me to do it?


Below you may find an example on what I mean.

NGINX LOG.:

timestamp="30/Nov/2016:17:26:43 -0200" client=%Client IP addr% request="GET %SOME DATA%' HTTP/1.1" request_length=255 bytes_sent=848 body_bytes_sent=470 referer=- user_agent="Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)" upstream_addr=%IP_ADDR%:8080 upstream_status=200 request_time=3.053 upstream_response_time=3.053 upstream_connect_time=0.000 upstream_header_time=3.052

APPS LOG

[30/11/2016:17:26:40 -0300] "GET %SOME DATA%' HTTP/1.0" - - 0.00-1


As you can see, application received the data @ 17:26:40 but NGINX recorded everything which means 17:26:43, I need to know when request was received by NGINX because APP and NGINX runs on the same machine. which doesn´t make much sense when I put all those data on my spreadsheet. So is it possible to log the entry of the request?

I´m running.: nginx version: nginx/1.10.1


Forgot to mention that I´ve found this patch here.: https://gist.github.com/rkbodenner/318681 but it works for older versions of NGINX


Thanks a lot for your help



Edited 1 time(s). Last edit at 12/01/2016 09:42AM by lockyZ.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 207
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 494 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready