Question
How do I enable DEBUG/TRACE logging for the Ververica Platform?
Answer
Note: This applies to Ververica Platform 2.0 and later.
appmanager
and gateway
are two components in the Ververica Platform. You can turn on DEBUG/TRACE logging either for both or for one of them if you know which one you are interested in.
There are two scenarios to turn on DEBUG/TRACE logging:
- At runtime during a deployment run
- At Ververica Platform startup time
Note: This article only discusses the logging of Ververica commercial components. To enable debug logging for your Apache Flink jobs, update your Ververica Platform deployment specification.
Turn on DEBUG logging at runtime
- Find out the Ververica Platform pod
kubectl get pods [--namespace <namespace>] \
-l system=ververica-platform -o name - Forward ports: appmanager (9081) and gateway (8081)
kubectl port-forward [--namespace <namespace>] \
pod/<ververica-platform-pod> 8081:8081 9081:9081 - In another terminal, check the current log level of appmanager
#tabs
##appmanager
curl localhost:9081/actuator/loggers/com.dataartisans
curl localhost:9081/actuator/loggers/com.ververica##gateway
curl localhost:8081/actuator/loggers/com.dataartisans
curl localhost:8081/actuator/loggers/com.ververica#--
- Set the log level to DEBUG (or TRACE)
#tabs
##appmanager
curl -i -X POST localhost:9081/actuator/loggers/com.dataartisans \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "DEBUG"}'
curl -i -X POST localhost:9081/actuator/loggers/com.ververica \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "DEBUG"}'##gateway
curl -i -X POST localhost:8081/actuator/loggers/com.dataartisans \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "DEBUG"}'
curl -i -X POST localhost:8081/actuator/loggers/com.ververica \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "DEBUG"}'#--
- Do your test or reproduce your issue.
- Collect the DEBUG (or TRACE) logs
#tabs
##appmanager
kubectl logs [--namespace namespace] <ververica-platform-pod> \
-c appmanager > appmanager.log##gateway
kubectl logs [--namespace namespace] <ververica-platform-pod> \ -c gateway > gateway.log
#--
- Reset the log level back
#tabs
##appmanager
curl -i -X POST localhost:9081/actuator/loggers/com.dataartisans \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": null}'
curl -i -X POST localhost:9081/actuator/loggers/com.ververica \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": null}'##gateway
curl -i -X POST localhost:8081/actuator/loggers/com.dataartisans \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": null}'
curl -i -X POST localhost:8081/actuator/loggers/com.ververica \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": null}'#--
Turn on DEBUG logging at startup time
Ververica Platform version >=2.1
- Add the following into your
values.yaml
:topLevelConfig:
Warning: `topLevelConfig` is at the root level of the YAML file, it is not under `vvp`!
logging.level.com.dataartisans: DEBUG
logging.level.com.ververica: DEBUG
Note: This is a temporary workaround and may be changed in future versions of Ververica Platform.
- Upgrade Ververica Platform with the new
values.yaml
and the version your used before, e.g.,3.0.0
# helm 3.x
Warning: This will stop, remove, and recreate your Ververica Platform pod.
helm upgrade vvp ververica/ververica-platform \
[--namespace namespace] \
--values values.yaml
--version 3.0.0
# helm 2.x
helm upgrade ververica/ververica-platform --name vvp \
[--namespace namespace] \
--values values.yaml
--version 3.0.0 - Collect the DEBUG logs with
kubectl logs
Ververica Platform version < 2.1
- Decompress the downloaded helm charts archive file, e.g.,
ververica-platform-2.0.4.tgz
, to a directory, e.g.,ververica-platform-2.0.4/
- Update
ververica-platform-2.0.4/templates/deployment.yaml
by adding the following container environment variables to the containerappmanager
and/orgateway
underenv
- name: logging.level.com.dataartisans
value: DEBUG - Upgrade Ververica Platform with
helm upgrade
and your originalvalues.yaml
and version, e.g.,3.0.0
:# helm 3.x
Warning: This will stop, remove, and recreate your Ververica Platform pod.
helm upgrade vvp ververica-platform-2.0.4 \
[--namespace namespace] \
--values values.yaml
--version 3.0.0
# helm 2.x
helm upgrade ververica-platform-2.0.4 --name vvp \
[--namespace namespace] \
--values values.yaml
--version 3.0.0 - Collect the DEBUG logs with
kubectl logs