Menu Close

1.3.2. 启用审计日志记录

3scale 使用 features.xml 配置文件启用一些全局功能。要将审计日志记录启用到 stdout,您必须从 ConfigMap 挂载此文件,以替换默认的 文件。依赖于 features.xml 的 OpenShift pod 是 system-appsystem-sidekiq

先决条件

  • 您必须在 OpenShift 上具有集群管理员访问权限。

步骤

  1. 输入以下命令将审计日志记录启用到 stdout

    oc patch configmap system -p '{"data": {"features.yml": "features: &default\n  logging:\n    audits_to_stdout: true\n\nproduction:\n  <<: *default\n"}}'
  2. 导出以下环境变量:

    export PATCH_SYSTEM_VOLUMES='{"spec":{"template":{"spec":{"volumes":[{"emptyDir":{"medium":"Memory"},"name":"system-tmp"},{"configMap":{"items":[{"key":"zync.yml","path":"zync.yml"},{"key":"rolling_updates.yml","path":"rolling_updates.yml"},{"key":"service_discovery.yml","path":"service_discovery.yml"},{"key":"features.yml","path":"features.yml"}],"name":"system"},"name":"system-config"}]}}}}'
  3. 输入以下命令将更新的部署配置应用到相关的 OpenShift pod:

    oc patch dc system-app -p $PATCH_SYSTEM_VOLUMES
    oc patch dc system-sidekiq -p $PATCH_SYSTEM_VOLUMES