Send logging and metric cluster data to IBM CloudEstimated reading time: 2 minutes
Logging on services other than IBM Cloud
If you want to configure logging and metrics for Docker EE to a remote logging service that is not IBM Cloud, see Configure UCP logging.
Enable logging and metrics
By default, logging and metrics are disabled. After you enable logging and metrics, containers are deployed to your cluster and begin to transmit data to IBM Cloud Log Analysis and Monitoring services.
Before you begin, make sure that you installed the IBM Cloud CLI and Docker for IBM Cloud plug-in.
To enable logging and metrics:
Log in to IBM Cloud. If you have a federated ID, use the
$ bx login [--sso]
After logging in to IBM Cloud, target the organization and space to which you want to send the logging and metric data:
$ bx target --cf
Connect to your swarm by setting the environment variables from the client certificate bundle that you downloaded. For example:
$ cd filepath/to/certificate/repo && source env.sh
Get the name of your cluster. If you did not set your environment variables, include your IBM Cloud infrastructure credentials.
$ bx d4ic list --sl-user user.name.1234567 --sl-api-key api_key
Enable logging and metrics. Replace the my_swarm variable with the name of your cluster and include the path to the Docker EE client certificate bundle. Include your IBM Cloud infrastructure credentials if you have not set the environment variables.
$ bx d4ic logmet --swarm-name my_swarm \ --cert-path filepath/to/certificate/repo \ --sl-user user.name.1234567 \ --sl-api-key api_key \ --enable
Disable logging and metrics
You might want to disable logging and metrics for reasons such as sending data to a different server specified in Docker Enterprise Edition UCP. After disabling, data is no longer transmitted to IBM Cloud Log Analysis and Monitoring services.
To disable logging and metrics, get the name of the swarm and run the disable command:
$ bx d4ic logmet --swarm-name my_swarm \ --cert-path filepath/to/certificate/repo \ --sl-user user.name.1234567 \ --sl-api-key api_key \ --disable
Review logging and metrics
Use the following links to access Kibana and Grafana for data transmitted to IBM Cloud. Select the IBM Cloud organization and space that your cluster is in to view its information.