Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Variable $time_short.

Gena Makhomed
May 27, 2021 02:50PM
On 27.05.2021 20:25, Maxim Dounin wrote:

>> Variable $time_short.
>>
>> Variable $time_short in form "1970/09/28 12:00:00".
>> Added to ngx_http_core_module, ngx_http_log_module,
>> and ngx_stream_core_module.

> You may want to be more specific about expected use cases, and why
> existing time variables are not enough.

Main purpose of variable $time_short is usage for logging, access.log.

Existing variables $time_iso8601 and $time_local has bad readability,
because these variables contains timezone after seconds and it has
no space between date and time fields.

Compare readability:

27/May/2021:21:19:12 +0300
27/May/2021:21:19:18 +0300
27/May/2021:21:19:25 +0300
27/May/2021:21:19:32 +0300
27/May/2021:21:19:43 +0300

2021-05-27T21:19:12+03:00
2021-05-27T21:19:18+03:00
2021-05-27T21:19:25+03:00
2021-05-27T21:19:32+03:00
2021-05-27T21:19:43+03:00

2021/05/27 21:19:12
2021/05/27 21:19:18
2021/05/27 21:19:25
2021/05/27 21:19:32
2021/05/27 21:19:43

But only proposed variable $time_short has excellent readability,
also this variable is very short, and contains no visual garbage.

If name $time_short is not very good - I can rewrite
my patch and rename it to just $time variable name.

P.S.

log_format standalone '$time_short\t$geoip_country_code\t$remote_addr'
'\t$upstream_cache_status\t$upstream_response_time'
'\t$status\t$scheme\t$host\t$request_method\t$request_uri'
'\t$body_bytes_sent\t$http_referer\t$http_user_agent';

--
Best regards,
Gena
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Variable $time_short.

Gena Makhomed 380 May 26, 2021 04:44PM

Re: [PATCH] Variable $time_short.

Maxim Dounin 108 May 27, 2021 01:26PM

Re: [PATCH] Variable $time_short.

Gena Makhomed 83 May 27, 2021 02:50PM

Re: [PATCH] Variable $time_short.

Maxim Dounin 96 May 28, 2021 05:56PM

Re: [PATCH] Variable $time_short.

Gena Makhomed 91 May 30, 2021 06:04AM

Re: [PATCH] Variable $time_short.

Maxim Dounin 136 May 31, 2021 12:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready