Logs for the Container Gateway in Docker
This topic provides sample commands that you can use to view and aggregate logs from your Container Gateway. The logs may contain Container Gateway-specific error messages, event messages, and warnings.
gateway94
This topic provides sample commands that you can use to view and aggregate logs from your Container Gateway. The logs may contain Container Gateway-specific error messages, event messages, and warnings.
Contents:
Viewing Logs
The Container Gateway can log to any external logging system supported by Docker. Use the
docker-compose logs
command to view logs.The following command prints the logs for all services that are defined in the
docker-compose.yml
file:$ docker-compose logs --follow
The following command prints logs for the service named "gateway" defined in the
docker-compose.yml
file:$ docker-compose --file docker-compose.yml logs --follow gateway
Aggregating Logs
Container Gateway logs can be aggregated and sent to any external logging system supported by Docker. The following example aggregates and sends the Container Gateway logs to the syslog server "syslog.domain.com" on port 514.
services: api-gateway: image: caapim/gateway:latest logging: driver: syslog options: syslog-address: "tcp://syslog.domain.com:514"
Setting Console Logging Thresholds (Available as of Version 9.4 CR 1)
A logging threshold determines the minimum log level that must be met for an event log to be propagated to the log sink. For example, if the container Gateway has been configured with a logging threshold of 'CONFIG', any logs classified as 'FINEST', 'FINER', or 'FINE' will not be propagated to the log sink or considered as an event. Only those logs with logging levels that meet or exceed the threshold (e.g., 'WARNING') will be propagated to the log sink.
You can set the logging thresholds for the container Gateway in one of two places: 1) In the System Properties file OR 2) As a Cluster-Wide Properties setting.
As of Version 9.4 CR 1, the
log.console.threshold
property now replaces the audit.detailThreshold
property for configuring console logging. A restart is only necessary if you are configuring the threshold as a system property setting.
To define the logging threshold in the System Properties file:
- Locate and open thesystem.propertiesfile in an editor.
- Add the following line:com.l7tech.server.log.console.threshold=<level>Where <level> is based on Java logging levels.
- Save the file. The threshold change takes effect after the Gateway is restarted.
To define the logging thresholds in the Cluster-Wide Properties:
- Locate the Manage Cluster-Wide Properties.
- Add a new cluster property with the keylog.console.threshold.
- Enter the desired threshold value. The values are based on Java logging levels. The default value is 'INFO'.
- Save your changes. The threshold change takes effect immediately.
Cluster-Wide Properties can be configured in either the Policy Manager or with the Restman Bundle.