Disabling Flex Gateway Log Output to Anypoint Platform
Anypoint Flex Gateway logging provides insights into startup, shutdown, API requests, API responses, policies, and Fluent Bit. Logging enables developers and administrators to identify and address issues or anomalies. However, disabling log output to Anypoint Platform might be necessary.
Before disabling log output, consider the potential impact on troubleshooting capabilities. In some cases, it’s more appropriate to adjust the log verbosity level.
You can disable sending the following logs to Anypoint Platform:
-
Runtime logs, including:
-
The startup and shutdown of Flex Gateway, Fluent Bit, and Envoy.
-
Deployed APIs and policies.
-
Possible misconfigurations of Flex Gateway or other errors.
-
-
Access logs, including:
-
The description of incoming interaction with Envoy over a period of time.
-
Incoming requests and responses for specific APIs.
-
You can only disable logs sent to Anypoint Platform. Standard output (STDOUT) remains unchanged. |
You disable sending logs to Anypoint Platform by using a local configuration file. The following tutorial describes how to create and deploy the file.
Before You Begin
Before configuring Flex Gateway log output, complete the following task:
-
Depending on your output, ensure that the service where you direct logs to is operational. For more information about log output services, refer to Configuring Flex Gateway Output for Third-Party Services.
Disable Anypoint Platform Log Output for Flex Gateway as a Linux Service
-
Create a YAML configuration file in your Flex Gateway configuration directory. For example:
sudo touch /usr/local/share/mulesoft/flex-gateway/conf.d/disable-logs-config.yaml
-
In the configuration file, set either
spec.logging.runtimeLogs.outputs.anypoint
orspec.logging.accessLogs.outputs.anypoint
todisabled
. The file resembles the following:apiVersion: gateway.mulesoft.com/v1beta1 kind: Configuration metadata: name: logging-config spec: logging: runtimeLogs: logLevel: info outputs: anypoint: disabled accessLogs: outputs: anypoint: disabled
-
Save the file.
Disable Anypoint Platform Log Output for Flex Gateway in a Container
If you have already added a volume for a folder with your Flex Gateway configuration files, skip to step 4. |
-
Press Ctrl+C to stop your Flex Gateway and any replicas.
-
Create a folder named
app
in the directory with your Flex Gateway configuration files. -
Navigate to the
app
directory. -
Create a new configuration YAML file named
disable-logs-config.yaml
. -
In the configuration file, set either
spec.logging.runtimeLogs.outputs.anypoint
orspec.logging.accessLogs.outputs.anypoint
todisabled
. The file resembles the following:apiVersion: gateway.mulesoft.com/v1beta1 kind: Configuration metadata: name: logging-config spec: logging: runtimeLogs: logLevel: info outputs: anypoint: disabled accessLogs: outputs: anypoint: disabled
-
Save the configuration file.
-
Restart your Flex Gateway with the configuration directory volume:
-
Docker
-
Podman
docker run --rm \ -v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \ -p 8080:8080 \ mulesoft/flex-gateway
Specify an optional name you want to assign to your Flex Replica by including the following: -e FLEX_NAME=<name-for-flex-replica> \
.podman run --rm \ -v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \ -p 8080:8080 \ docker.io/mulesoft/flex-gateway
Specify an optional name you want to assign to your Flex Replica by including the following: -e FLEX_NAME=<name-for-flex-replica> \
. -
Disable Anypoint Platform Log Output for Flex Gateway in a Kubernetes Cluster
To disable logging to Anypoint Platform:
-
Create a new resource using a YAML configuration file with the following example output configuration details:
apiVersion: gateway.mulesoft.com/v1beta1 kind: Configuration metadata: name: logging-config spec: logging: runtimeLogs: logLevel: info outputs: anypoint: disabled accessLogs: outputs: anypoint: disabled
-
Set either
spec.logging.runtimeLogs.outputs.anypoint
orspec.logging.accessLogs.outputs.anypoint
todisabled
.
Disable Anypoint Platform Log Output for Flex Gateway in an OpenShift Cluster
To disable logging to Anypoint Platform:
-
Create a new resource using a YAML configuration file with the following example output configuration details:
apiVersion: gateway.mulesoft.com/v1beta1 kind: Configuration metadata: name: logging-config spec: logging: runtimeLogs: logLevel: info outputs: anypoint: disabled accessLogs: outputs: anypoint: disabled
-
Set either
spec.logging.runtimeLogs.outputs.anypoint
orspec.logging.accessLogs.outputs.anypoint
todisabled
.