On an AIX system running Genero Application Server (GAS) in conjunction with Apache HTTP server the timestamps in the GAS logs don't match the system time. This note explains how to correct this behavior.
On an AIX system, you have set-up Informix Genero Application Server (GAS) to run through Apache HTTP server, as indicated in the product documentation. You have noted that while the log entries for Apache use the time set for the system, the log entries for GAS use a different time, usually the Coordinated Universal Time (UTC). For example, if the system command date returns:
Thu Sep 27 14:59:40 GST 2012
a request received at this time would be recorded in the Apache log ( apache_home /logs/access_log ) as
+0400] "POST /gas/ws/r/MyApp HTTP/1.1"
The same request, forwarded by Apache to GAS will be recorded in the GAS log ( under $FGLASDIR/log/20120927/fastcgidispatch.log ) as:
.798286 "Incoming request" /ws/r/MyApp
When GAS is launched from Apache, because of the way Apache makes environment variables visible to modules ( mod_fastcgi in this case ), the value of $TZ won't be passed to GAS (as for any other variable). Since GAS finds $TZ undefined, it will use UTC as timezone.
This also affects any Genero service, application and other child process that is configured to run through GAS unless they define a specific value for the environment variable $TZ in their local configuration.
Resolving the problem
One way to pass $TZ to GAS is to add
to the configuration for mod_fastcgi inside httpd.conf as in (lines may appear split due to formatting):
FastCgiServer /genero/gas/bin/wrapper.fcgi -idle-timeout 300 -initial-env FGLASDIR=/genero/gas -initial-env TZ
Alias /gas /genero/gas/bin/wrapper.fcgi
In this way the value defined in the start-up environment for Apache is passed to GAS.
An alternative solution is to add and export $TZ in the file $FGLASDIR/envas, which is imported by wrapper.fcgi. To make sure that the value is in sync with what the OS defines, the following lines can be added:
. /etc/environment #import the default OS environment
export TZ #export TZ to child processes
Note that this behavior is specific of AIX while on other operating systems such as Linux, the system timezone will still be used even if the variable $TZ is not defined.
If on other operating systems you note something similar to what this article describes, the most likely cause is that some processes under GAS are started with a specific $TZ value, that differs from the system timezone, in their startup configuration.
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.