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.
- Change to the ZOA_HOME directory.
- Open the file zoa_env.config in a text editor.
- Locate the property
LOGGING_DRIVER
, set its value to journald, then save and close the file. - Run the following commands:
./bin/podmanManageZoa.sh down ./bin/podmanManageZoa.sh up
- 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