Configure logging

You can configure three approaches to logging: stdout, json-file, and journald.

stdout

All software containers that are provided in this solution with the exception of the Z Resource Discovery Data Service container and the PostgreSQL Kafka Connect container write log data exclusively to stdout. This approach to logging allows the container management tool to take control of the log output and manage it according to its own built-in facilities.

json-file

Every container management tool offers a number of different logging drivers. Out of the box, the software containers are configured to use the simplest possible logging driver that is available in both Docker and Podman: json-file.

json-file does not need any prerequisites. However, data logged with this driver do not persist beyond the lifetime of the container, and therefore might not be suitable for long-term log retention. Also, this driver does not offer any log rotation or log compression.

journald

Another option that is available for both Docker and Podman is the journald driver. This driver will route container log output to the journald facility, which allows container logs to be viewed and managed along with all other application output logged via journald.

If you want to use the journald driver for logging of the software containers, perform the following steps:
  1. Change to the ZOA_HOME directory.
  2. Open the file zoa_env.config in a text editor.
  3. Locate the property LOGGING_DRIVER, set its value to journald, then save and close the file.
  4. Run the following commands:
    ./bin/podmanManageZoa.sh down
    ./bin/podmanManageZoa.sh up
    
Support of this feature is subject to the limitations of the journalctl subsystem on Linux® and the support for it that is provided in Docker and Podman. For example, on Red Hat® Enterprise Linux 8, the journald driver can only be used with Podman if the Podman containers are run with the root user ID. Likewise, access to the log data via journalctl is typically only available to root and user IDs with sudo all privileges.
  • Example for the gateway service that run under Podman:
    sudo journalctl -f CONTAINER_NAME=gateway
  • Example for the gateway service that run under Docker:
    sudo journalctl -f CONTAINER_NAME=zoa-gateway