diff --git a/k8s/base/deployment.yaml b/k8s/base/deployment.yaml index 9d9b20cd..5aafe4db 100644 --- a/k8s/base/deployment.yaml +++ b/k8s/base/deployment.yaml @@ -46,3 +46,6 @@ spec: - name: app-properties secret: secretName: set-api-properties + - name: log4j-config + configMap: + name: log4j2-properties diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml index 27a3601d..be0fa202 100644 --- a/k8s/base/kustomization.yaml +++ b/k8s/base/kustomization.yaml @@ -10,4 +10,10 @@ labels: secretGenerator: - name: set-api-properties files: - - set.user.properties \ No newline at end of file + - set.user.properties + +#generate config mapping for log4j2.xml file +configMapGenerator: + - name: log4j2-properties + files: + - log4j2-spring.xml \ No newline at end of file diff --git a/k8s/overlays/cloud/deployment_patch.yaml.template b/k8s/overlays/cloud/deployment_patch.yaml.template index 1e59364c..1d4d9c82 100644 --- a/k8s/overlays/cloud/deployment_patch.yaml.template +++ b/k8s/overlays/cloud/deployment_patch.yaml.template @@ -21,6 +21,7 @@ spec: -Delastic.apm.server_urls=${ELASTIC_APM_SERVERS} -Delastic.apm.service_name=${APP_NAME} -Delastic.apm.environment=${K8S_NAMESPACE}" + -Dlogging.config=/opt/app/config/log4j2-spring.xml" resources: requests: memory: "${MEMORY_REQUEST}M" diff --git a/set-web/src/main/resources/log4j2.xml.template b/set-web/src/main/resources/log4j2-spring.xml.template similarity index 100% rename from set-web/src/main/resources/log4j2.xml.template rename to set-web/src/main/resources/log4j2-spring.xml.template