Customizing APL Logging for ECDs (4.2)

Customizing APL Logging for ECDs (4.2)

If you want to customize the APL logging when using the log.* APL functions, described in https://infozone.atlassian.net/wiki/spaces/UEPE3D/pages/52559891, you can configure this in your Kubernetes cluster.

To customize the APL logging:

  1. Create a ConfigMap in your Kubernetes cluster.
    This config map should contain your desired logging configuration.

Example - Creating ConfigMap with Logging Configuration

apiVersion: v1 kind: ConfigMap metadata: name: apl-log4j-config data: apl-log4j.properties: | log4j.rootLogger=ALL, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.file=${mz.home}/log/{workflow}.log log4j.appender.stdout.layout=com.digitalroute.apl.log.JsonLayout log4j.appender.stdout.layout.MdcFieldsToLog=pico, workflow, agent, tag

Only the Log4j version 1 syntax is supported.

  1. Add an extraConfigMapMounts configuration for your ConfigMap in your ECD specification as described in https://infozone.atlassian.net/wiki/spaces/UEPE3D/pages/54494330 , and the apl.custom.log.config system property.

Example - ECD Specification with extraConfigMapMounts and apl.custom.log.config

apiVersion: mz.digitalroute.com/v1alpha1 kind: ECDeployment metadata: name: my-ecd spec: jvmArgs: - Xms512m - Xmx512m resources: limits: memory: 640Mi requests: memory: 640Mi extraConfigMapMounts: - configMapName: apl-log4j-config mountPath: /mnt/apl-logging name: apl-log4j-vol systemProperties: - apl.custom.log.config=/mnt/apl-logging/apl-log4j.properties ...

The value of the apl.custom.log.config system property must point to the same path as the ConfigMap file is mounted under.

You can inspect the EC Pod specification by running the following kubectl command:

kubectl exec -it <EC Pod> -- ls -la /mnt/apl-logging