LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache Piped Logging Inaccurate strftime results (https://www.linuxquestions.org/questions/linux-server-73/apache-piped-logging-inaccurate-strftime-results-4175516532/)

SteveInTallyFL 08-27-2014 10:03 AM

Apache Piped Logging Inaccurate strftime results
 
Apache 2.2.23.1-64 (Provided by SAS, Inc. as part of their middle tier server integration). Created a CustomLog entry in <VirtualHost> configuration for the access logging. Implemented piped logging (rotatelogs) and specified target name as "access_log.%Y-%m-%d-%H". Verified that the date and time on the system return accurate results. But when the logs are generated the %Y return 2015 instead of 2014, %m return 10 instead of 08, %d returns 21 instead of 27, and %H returns a wrong 2-digit hour of creation (and it is not the GMT -5 offset of our local time zone). I have no idea where to begin to troubleshoot this to get the functions to resolve the date/time correctly. Anyone have any suggestions?

unSpawn 08-31-2014 07:05 PM

'man strftime' says it honours the TZ and LC_TIME environment variables. So maybe you could (example) turn
Code:

CustomLog "|/path/to/rotatelogs -l /var/logs/access_log.%Y-%m-%d-%H 86400" common
into
Code:

CustomLog "|/bin/env TZ=EDT /path/to/rotatelogs -l /var/logs/access_log.%Y-%m-%d-%H 86400" common
and see if forcing it that way works?


All times are GMT -5. The time now is 02:48 AM.