Follow the steps below to change NCP log level. The example here covers how to switch to the DEBUG log level.
1. Identify the current NCP master and VM the process is running on:
bosh ssh -d service-instance_6a4aeb5c-b68f-43ac-94f0-3efdcc765bbf master "sudo /var/vcap/jobs/ncp/bin/nsxcli -c get ncp-master status" | grep "This instance is the NCP master"
master/8df6e9e2-962d-46af-b885-9e51cf9f22da: stdout | This instance is the NCP master
2. SSH to the VM identified in Step 1 and switch to root user:
bosh ssh -d service-instance_6a4aeb5c-b68f-43ac-94f0-3efdcc765bbf master/8df6e9e2-962d-46af-b885-9e51cf9f22da
master/8df6e9e2-962d-46af-b885-9e51cf9f22da:~$ sudo su -
3. Invoke the
nsxcli
. Check the current and available log levels:
master/8df6e9e2-962d-46af-b885-9e51cf9f22da:~# /var/vcap/jobs/ncp/bin/nsxcli
NSX CLI (NCP). Press ? for command list or enter: help
65bcb758-144d-42ff-a9a3-e02c4e6f7e0e> get ncp-log-level
NCP log level is NOTSET
65bcb758-144d-42ff-a9a3-e02c4e6f7e0e> set ncp-log-level
NOTSET Log level
DEBUG Log level
INFO Log level
WARNING Log level
ERROR Log level
CRITICAL Log level
4. Change the log level to one of the available log levels. In this example, it is
DEBUG
.
65bcb758-144d-42ff-a9a3-e02c4e6f7e0e> set ncp-log-level DEBUG