Contact Us 1-800-596-4880

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.

20%

25%

20%

20%

Before You Begin

Before configuring Flex Gateway log output, complete the following task:

Disable Anypoint Platform Log Output for Flex Gateway as a Linux Service

  1. 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
  2. In the configuration file, set either spec.logging.runtimeLogs.outputs.anypoint or spec.logging.accessLogs.outputs.anypoint to disabled. 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
  3. 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.
  1. Press Ctrl+C to stop your Flex Gateway and any replicas.

  2. Create a folder named app in the directory with your Flex Gateway configuration files.

  3. Navigate to the app directory.

  4. Create a new configuration YAML file named disable-logs-config.yaml.

  5. In the configuration file, set either spec.logging.runtimeLogs.outputs.anypoint or spec.logging.accessLogs.outputs.anypoint to disabled. 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
  6. Save the configuration file.

  7. 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:

  1. 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
  2. Set either spec.logging.runtimeLogs.outputs.anypoint or spec.logging.accessLogs.outputs.anypoint to disabled.

Disable Anypoint Platform Log Output for Flex Gateway in an OpenShift Cluster

To disable logging to Anypoint Platform:

  1. 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
  2. Set either spec.logging.runtimeLogs.outputs.anypoint or spec.logging.accessLogs.outputs.anypoint to disabled.