php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69561 FPM access.log strftime locale not configurable
Submitted: 2015-05-01 21:06 UTC Modified: 2017-10-24 07:45 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mb at lunetics dot com Assigned:
Status: Open Package: FPM related
PHP Version: 5.6.8 OS: FreeBSD 10.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mb at lunetics dot com
New email:
PHP Version: OS:

 

 [2015-05-01 21:06 UTC] mb at lunetics dot com
Description:
------------
It seems the access.log / php-fpm directive "guesses" the locale from the timezone set?

Systemtimezone is set to "Europe/Berlin" -> strftime %b -> "Mai"

tried setting the timezone to "Europe/London" -> strftime %b -> "Mail"


Would it be possible to set the locale for the access.log strftime parsing?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-01 21:26 UTC] stas@php.net
-Assigned To: +Assigned To: fat
 [2015-05-01 21:27 UTC] mb at lunetics dot com
Okay, did some further testing.

So somewhere hidden there's a 

setlocale(LC_ALL, 'de_DE.ISO8859-1', 'de_DE.ISO8859-15E');

call. So the current scripts Locale seems to affect the log output (which should be mostly English in my opinion)

So it would be more a feature request having a custom locale for the fpm access.log strftime locale.
 [2015-05-01 22:27 UTC] rasmus@php.net
This is because fpm logs before rshutdown is called for some reason. We reset the locale in rshutdown and other sapis will log after shutdown.

eg.

https://github.com/php/php-src/blob/php-5.6.8/sapi/fpm/fpm/fpm_main.c#L1987-L1992

It should be safe to change that order
 [2015-05-01 22:33 UTC] rasmus@php.net
I tested this fix in the master branch:

https://gist.github.com/anonymous/a9922882a355255dd032

And it seems to be working fine. @fat, any reason to not log after request shutdown here?
 [2017-10-24 07:45 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: fat +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC