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 4.2.0 version is started and that the 4.2.0 version of 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
Info
Flags:
- Required :
--environment
or-e
: The environment that the command is executed on - Optional :
--format
: pretty-print correlation logging components using Go templates
- Required :
-
Response
-
Info
- The
get correlation-logging
command 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 4.2.0 version is started and that the 4.2.0 version of 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 --component-name <component-name> --enable <true-or-false> --denied-threads <denied-threads> --environment <environment>
Info
Flags:
- Required :
--environment
or-e
: The environment that the command is executed
--component-name
or-i
: Component name
--enable
: Enable (can be true or false) - Optional :
--denied-threads
: Denied threads
- Required :
-
Response
-
Info
- Supported component name values :
http
,jdbc
,ldap
,synapse
ormethod-calls
. - Supported values for enable:
true
orfalse
. - The
set correlation-logging
command can be executed only with a user who has super admin permissions.
-