Enabling Correlation Logs with apictl¶
WSO2 API Controller (apictl) allows you to enable/disable correlation logs in WSO2 API Manager (WSO2 API-M) without a server restart. (For more information on correlation logs support in WSO2 API-M, see Monitoring Correlation Logs)
Get the correlation logging components in an environment¶
Follow the instructions below to get the correlation logging components in an environment using apictl:
- Make sure that the WSO2 API-M is started and the apictl is set up.
For more information, see Download and Initialize the apictl. - Log in to the WSO2 API-M in the environment by following the instructions in Login to an Environment.
-
Run the corresponding apictl command below to get the correlation logging components in an environment.
-
Get the correlation logging components in an environment.
-
Command
apictl get correlation-logging -e <environment>Info
Flags:
- Required :
--environmentor-e: The environment that the command is executed on - Optional :
--format: pretty-print correlation logging components using Go templates
Example
apictl get correlation-logging -e dev - Required :
-
Response
COMPONENT_NAME ENABLED PROPERTIES http false - jdbc false deniedThreads : MessageDeliveryTaskThreadPool, HumanTaskServer, BPELServer, CarbonDeploymentSchedulerThread ldap false - synapse true - method-calls false -
-
Info
- The
get correlation-loggingcommand can be executed only with a user who has super admin permissions.
-
Set the correlation configs for a correlation logging component in an environment¶
Follow the instructions below to set the correlation configs for a correlation logging component in an environment using apictl:
- Make sure that the WSO2 API-M is started and the apictl is set up.
For more information, see Download and Initialize the apictl. - Log in to the WSO2 API-M in the environment by following the instructions in Login to an Environment.
-
Run the corresponding apictl command below to set the correlation configs for a correlation logging component in an environment.
-
Set the correlation configs for a correlation logging component in an environment.
-
Command
apictl set correlation-logging --component-name <component-name> --enable <true-or-false> --environment <environment>apictl set correlation-logging -i <component-name> --enable <true-or-false> -e <environment>apictl set correlation-logging --component-name <component-name> --enable <true-or-false> --denied-threads <denied-threads> --environment <environment>Info
Flags:
- Required :
--environmentor-e: The environment that the command is executed
--component-nameor-i: Component name
--enable: Enable (can be true or false) - Optional :
--denied-threads: Denied threads
Example
apictl set correlation-logging --component-name http --enable true -e devapictl set correlation-logging --component-name jdbc --enable true --denied-threads MessageDeliveryTaskThreadPool,HumanTaskServer,BPELServer -e dev - Required :
-
Response
Correlation component http is successfully enabled.
-
Info
- Supported component name values :
http,jdbc,ldap,synapseormethod-calls. - Supported values for enable:
trueorfalse. - The
set correlation-loggingcommand can be executed only with a user who has super admin permissions.
-