Skip to content

Commit af87d16

Browse files
fix(logging): Adding configurable timezone support for log timestamps
Signed-off-by: Hrishikesh Nalawade <[email protected]>
1 parent d12d84e commit af87d16

File tree

9 files changed

+12
-3
lines changed

9 files changed

+12
-3
lines changed

caching-service-package/src/main/resources/bin/start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${CACHING_CODE} ${JAVA_BIN_DIR}java \
241241
-Dspring.profiles.active=${ZWE_configs_spring_profiles_active:-} \
242242
-Dspring.profiles.include=$LOG_LEVEL \
243243
-Dapiml.logs.location=${ZWE_zowe_logDirectory} \
244+
-Dapiml.logging.timezone=${ZWE_zowe_logging_timezone} \
244245
-Dapiml.health.protected=${ZWE_configs_apiml_health_protected:-true} \
245246
-Dapiml.service.port=${ZWE_configs_port:-7555} \
246247
-Dapiml.service.hostname=${ZWE_haInstance_hostname:-localhost} \

caching-service/src/main/resources/application.yml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ logging:
4141
org.apache.tomcat.util.net.SSLUtilBase: ERROR
4242
org.springframework.security.config.annotation.web.builders.WebSecurity: ERROR
4343
javax.net.ssl: ERROR
44+
timezone: ${apiml.logging.timezone:UTC}
4445

4546
eureka:
4647
client:

caching-service/src/main/resources/logback.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<property name="MIN_INDEX" value="${rollingPolicy.minIndex:-1}"/>
66
<property name="MAX_FILE_SIZE" value="${rollingPolicy.file.maxSize:-50MB}"/>
77
<property name="STORAGE_LOCATION" value="${apiml.logs.location}" />
8-
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
8+
<property name="LOGGING_TIMEZONE" value="${logging.timezone:-UTC}"/>
9+
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,${LOGGING_TIMEZONE}} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
910

1011
<turboFilter class="org.zowe.apiml.product.logging.UseridFilter"/>
1112
<if condition='property("spring.config.activate.on-profile").contains("debug")||property("spring.config.activate.on-profile").contains("diag")||property("spring.config.activate.on-profile").contains("dev")'>

gateway-package/src/main/resources/bin/start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${GATEWAY_CODE} ${JAVA_BIN_DIR}java \
304304
-Dapiml.connection.idleConnectionTimeoutSeconds=${ZWE_configs_apiml_connection_idleConnectionTimeoutSeconds:-5} \
305305
-Dapiml.connection.timeToLive=${ZWE_configs_apiml_connection_timeToLive:-10000} \
306306
-Dapiml.logs.location=${ZWE_zowe_logDirectory} \
307+
-Dapiml.logging.timezone=${ZWE_zowe_logging_timezone} \
307308
-Dapiml.health.protected=${ZWE_configs_apiml_health_protected:-true} \
308309
-Dapiml.security.ssl.verifySslCertificatesOfServices=${verifySslCertificatesOfServices} \
309310
-Dapiml.security.ssl.nonStrictVerifySslCertificatesOfServices=${nonStrictVerifySslCertificatesOfServices:-false} \

gateway-service/src/main/resources/application.yml

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ logging:
154154
io.netty.resolver.dns: WARN
155155
javax.net.ssl: ERROR
156156
org.apache.tomcat.util.net.SSLUtilBase: ERROR
157+
timezone: ${apiml.logging.timezone:UTC}
157158

158159
management:
159160
endpoint:

gateway-service/src/main/resources/logback-gateway.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<property name="MIN_INDEX" value="${rollingPolicy.minIndex:-1}"/>
66
<property name="MAX_FILE_SIZE" value="${rollingPolicy.file.maxSize:-50MB}"/>
77
<property name="STORAGE_LOCATION" value="${apiml.logs.location}" />
8-
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
8+
<property name="LOGGING_TIMEZONE" value="${logging.timezone:-UTC}"/>
9+
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,${LOGGING_TIMEZONE}} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
910

1011
<turboFilter class="org.zowe.apiml.product.logging.UseridFilter"/>
1112
<if condition='property("spring.config.activate.on-profile").contains("debug")||property("spring.config.activate.on-profile").contains("diag")||property("spring.config.activate.on-profile").contains("dev")'>

zaas-package/src/main/resources/bin/start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${ZAAS_CODE} ${JAVA_BIN_DIR}java \
307307
-Dapiml.connection.idleConnectionTimeoutSeconds=${ZWE_configs_apiml_connection_idleConnectionTimeoutSeconds:-5} \
308308
-Dapiml.cache.storage.location=${ZWE_zowe_workspaceDirectory}/api-mediation/${ZWE_haInstance_id:-localhost} \
309309
-Dapiml.logs.location=${ZWE_zowe_logDirectory} \
310+
-Dapiml.logging.timezone=${ZWE_zowe_logging_timezone} \
310311
-Dapiml.security.ssl.verifySslCertificatesOfServices=${verifySslCertificatesOfServices:-true} \
311312
-Dapiml.security.ssl.nonStrictVerifySslCertificatesOfServices=${nonStrictVerifySslCertificatesOfServices:-false} \
312313
-Dapiml.security.auth.zosmf.serviceId=${ZWE_configs_apiml_security_auth_zosmf_serviceId:-${ZWE_components_gateway_apiml_security_auth_zosmf_serviceId:-ibmzosmf}} \

zaas-service/src/main/resources/application.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ logging:
2626
org.apache.http.conn.ssl.DefaultHostnameVerifier: DEBUG #logs only SSLException
2727
org.eclipse.jetty.util.ssl: ERROR
2828
org.apache.tomcat.util.net.SSLUtilBase: ERROR
29+
timezone: ${apiml.logging.timezone:UTC}
2930

3031
apiml:
3132
service:

zaas-service/src/main/resources/logback-zaas.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<property name="MIN_INDEX" value="${rollingPolicy.minIndex:-1}"/>
66
<property name="MAX_FILE_SIZE" value="${rollingPolicy.file.maxSize:-50MB}"/>
77
<property name="STORAGE_LOCATION" value="${apiml.logs.location}" />
8-
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
8+
<property name="LOGGING_TIMEZONE" value="${logging.timezone:-UTC}"/>
9+
<property name="apimlLogPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,${LOGGING_TIMEZONE}} %clr&lt;${logbackService:-${logbackServiceName}}:%thread:${PID:- }&gt; %magenta(%X{userid:-}) %cyan(%-5level) %clr\(\(%logger{15}\)\) %msg%n"/>
910

1011
<turboFilter class="org.zowe.apiml.product.logging.UseridFilter"/>
1112
<if condition='property("spring.config.activate.on-profile").contains("debug")||property("spring.config.activate.on-profile").contains("diag")||property("spring.config.activate.on-profile").contains("dev")'>

0 commit comments

Comments
 (0)